Skip to content

Commit

Permalink
initial changes (Issue #350)
Browse files Browse the repository at this point in the history
  • Loading branch information
OliverWang13 committed Feb 25, 2024
1 parent d3be316 commit 29bbeb8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
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}"
}
}
}

0 comments on commit 29bbeb8

Please sign in to comment.