Skip to content

Commit

Permalink
fix: set options for <select> elements
Browse files Browse the repository at this point in the history
  • Loading branch information
jure965 committed Oct 28, 2021
1 parent f81a96a commit 8096f5f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function sendNextText() {
// return browser.runtime.sendMessage({
return chrome.runtime.sendMessage({
message: "loremTextResponse",
text: text
text: text,
});
});
}
Expand Down
6 changes: 6 additions & 0 deletions src/js/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@ function populateProviders(providers, currentProviderId) {
} else {
optionElement.value = entry[1];
}
} else {
// look for <select> element
const selectElement = optionsElement.querySelector(`select[name=${entry[0]}]`);
if (selectElement) {
selectElement.value = entry[1];
}
}
});
});
Expand Down

0 comments on commit 8096f5f

Please sign in to comment.