Skip to content

Commit

Permalink
Fix roll20 discord activity integration for Firefox
Browse files Browse the repository at this point in the history
I hate Firefox...
  • Loading branch information
kakaroto committed Nov 17, 2024
1 parent 7f9d994 commit 2f35e07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,9 @@ function listenToDiscordFrames() {
if (!chrome.webNavigation || webNavigationReady) return;
console.log("Listening to webNavigation events");
chrome.webNavigation.onCompleted.addListener((details) => {
if (details.documentLifecycle === "active" && details.frameType == "sub_frame" &&
urlMatches(details.url, ROLL20_DISCORD_ACTIVITY_DOMAIN)) {
if (urlMatches(details.url, ROLL20_DISCORD_ACTIVITY_DOMAIN) &&
((details.documentLifecycle === "active" && details.frameType == "sub_frame") ||
details.documentLifecycle === undefined /* Firefox... */)) {
console.log("Injecting roll20 content script into frame : ", details.frameId);
injectRoll20Scripts([{id: details.tabId}], details.frameId);
}
Expand Down

0 comments on commit 2f35e07

Please sign in to comment.