Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firefox MV3 Migration #462

Merged
merged 17 commits into from
May 22, 2024
Next Next commit
initial changes (Issue #350)
  • Loading branch information
OliverWang13 committed Feb 25, 2024
commit 29bbeb80bb7014e12b41ff9fc7196621b2e2031a
8 changes: 5 additions & 3 deletions src/background/protection/protection-ff.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const listenerCallbacks = {
onBeforeSendHeaders: async (details) => {
await updateDomainlist(details);

if (sendSignal) {
if (true) {
signalPerTab[details.tabId] = true;
return addHeaders(details);
}
Expand Down Expand Up @@ -100,7 +100,7 @@ const listenerCallbacks = {
*/
onCommitted: async (details) => {
initIAB(sendSignal);
if (sendSignal) {
if (true) {
addDomSignal(details);
updatePopupIcon(details);
}
Expand All @@ -119,6 +119,7 @@ const listenerCallbacks = {
* @returns {array} details.requestHeaders
*/
function addHeaders(details) {
console.log("addHeaders called");
for (let signal in headers) {
let s = headers[signal];
details.requestHeaders.push({ name: s.name, value: s.value });
Expand All @@ -131,7 +132,8 @@ function addHeaders(details) {
* @param {object} details - retrieved info passed into callback
*/
function addDomSignal(details) {
chrome.tabs.executeScript(details.tabId, {
console.log("addDomSignal called");
chrome.scripting.executeScript(details.tabId, {
file: "../../content-scripts/injection/gpc-dom.js",
frameId: details.frameId, // Supposed to solve multiple injections
// as opposed to allFrames: true
Expand Down
21 changes: 15 additions & 6 deletions src/manifests/firefox/manifest-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
"version": "4.3.1",
"description": "OptMeowt allows Web users to make use of their rights to opt out from the sale and sharing of personal data",
"permissions": [
"<all_urls>",
"webRequestBlocking",
"webRequest",
"webNavigation",
"storage",
"activeTab",
"cookies",
"tabs"
"tabs",
"scripting"
],
"host_permissions": [
"<all_urls>"
],
"icons": {
"128": "assets/face-icons/icon128-face-circle.png"
},
"browser_action": {
"action": {
"default_title": "OptMeowt",
"default_popup": "popup.html"
},
Expand All @@ -35,9 +38,15 @@
"scripts": ["background.bundle.js"]
},
"web_accessible_resources": [
"json/*.json"
],
"manifest_version": 2,
"manifest_version": 3,
"incognito": "spanning",
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self'"
},
"browser_specific_settings": {
"gecko": {
"id": "{7f22397f-fb61-47e2-9e4b-4ddd98faa275}"
}
}
}