-
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.
Merge pull request #19 from IbrahimMohammed47/ff-mv2
Fix firefox host permissions
- Loading branch information
Showing
5 changed files
with
52 additions
and
21 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export function sendMessageToTab(tabId, msgObj) { | ||
return browser.tabs.sendMessage(tabId, msgObj); | ||
} | ||
|
||
export function setIcon(details) { | ||
return browser.browserAction.setIcon(details); | ||
} | ||
|
||
export function executeScript(injection) { | ||
return browser.scripting.executeScript(injection); | ||
} | ||
|
||
export function cacheSet(keyValuesObj) { | ||
return browser.storage.local.set(keyValuesObj); | ||
} |
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,18 @@ | ||
import { handleTabVisit } from "../../background.js"; | ||
import * as actions from "./worker-actions.js"; | ||
|
||
// Listen when user switches to a tab (activates it) | ||
browser.tabs.onActivated.addListener((activeInfo) => { | ||
browser.tabs.get(activeInfo.tabId, (tab) => { | ||
if (tab && tab.url) { | ||
handleTabVisit(actions, activeInfo.tabId, tab.url); | ||
} | ||
}); | ||
}); | ||
|
||
// Listen for tab updates (when the URL changes) | ||
browser.tabs.onUpdated.addListener((tabId, changeInfo, tab) => { | ||
if (tabId && changeInfo.status === "complete") { | ||
handleTabVisit(actions, tabId, tab.url); | ||
} | ||
}); |
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