-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A big update with both fixes and new features.
- Loading branch information
Showing
16 changed files
with
191 additions
and
121 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 |
---|---|---|
@@ -1,21 +1,24 @@ | ||
var IsFirefox = false; // js is funny but I'll leave it in global for safety | ||
|
||
(async () => { | ||
const env = this.chrome || this.browser; | ||
var IsFirefox = false; | ||
|
||
if (env.runtime.getBrowserInfo) { | ||
let BrowserInfo = await env.runtime.getBrowserInfo(); | ||
IsFirefox = BrowserInfo.name === "Firefox" || BrowserInfo.vendor === "Mozilla"; | ||
IsFirefox = BrowserInfo.name == "Firefox" || BrowserInfo.vendor == "Mozilla"; | ||
} | ||
env.runtime.onMessage.addListener((Message, Sender, Respond) => { | ||
switch (Message.Operation) { | ||
case "SeriStyle_LoadScript": | ||
(this.chrome || this.browser).scripting.executeScript({ | ||
env.scripting.executeScript({ | ||
target: IsFirefox | ||
? { tabId: Sender.tab.id } // jshint ignore: line | ||
: { tabId: Sender.tab.id, documentIds: Sender.documentId ? [Sender.documentId] : undefined }, | ||
files: [Message.Args[0]] | ||
}); | ||
return; | ||
case "SeriStyle_OpenURL": | ||
env.tabs.create({ url: env.runtime.getURL(Message.Args[0]) }); | ||
return; | ||
} | ||
}); | ||
})(); |
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
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
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
Oops, something went wrong.