-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Automatically open options if language is not set.
We check the language at each button click. Turned out to be tricker than I though but it's worth it I think.
- Loading branch information
1 parent
b945c0e
commit 516f6e1
Showing
5 changed files
with
75 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// The following is needed to open option page automatically | ||
// if the locale is not set | ||
// https://stackoverflow.com/questions/49192636/how-can-i-open-my-options-html-currently-i-get-cannot-read-property-create-of | ||
// | ||
// This Js file is run in the background, see: | ||
// https://developer.chrome.com/extensions/background_pages | ||
chrome.runtime.onMessage.addListener(function(message) { | ||
switch (message.action) { | ||
case "openOptionsPage": | ||
openOptionsPage(); | ||
break; | ||
default: | ||
break; | ||
} | ||
}); | ||
|
||
function openOptionsPage(){ | ||
chrome.runtime.openOptionsPage(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters