[tor-commits] [pluggable-transports/snowflake-webext] 02/04: [WIP] Migrate to Manifest V3

gitolite role git at cupani.torproject.org
Tue Nov 1 20:17:42 UTC 2022


This is an automated email from the git hooks/post-receive script.

cohosh pushed a commit to branch i29
in repository pluggable-transports/snowflake-webext.

commit 2b7e30bc1d12473c36c5b21fc2ca78c36d094039
Author: Arlo Breault <arlolra at gmail.com>
AuthorDate: Fri Aug 6 14:36:06 2021 -0400

    [WIP] Migrate to Manifest V3
    
    Implements #29
    
    Unfortunately, this runs in to a "ReferenceError: RTCPeerConnection is
    not defined" which is from,
    https://github.com/w3c/webrtc-extensions/issues/77
---
 init-webext.js            | 9 ++-------
 webext/manifest_base.json | 9 +++------
 2 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/init-webext.js b/init-webext.js
index 3bbdfde..a1126eb 100644
--- a/init-webext.js
+++ b/init-webext.js
@@ -197,7 +197,7 @@ class WebExtUI extends UI {
         96: "assets/toolbar-on-96.png"
       };
     }
-    chrome.browserAction.setIcon({
+    chrome.action.setIcon({
       path: path,
     });
   }
@@ -284,11 +284,6 @@ var
     snowflake.beginWebRTC();
   };
 
-  window.onunload = function() {
-    if (snowflake !== null) { snowflake.disable(); }
-    return null;
-  };
-
-  window.onload = init;
+  init();
 
 }());
diff --git a/webext/manifest_base.json b/webext/manifest_base.json
index 6de42ab..6d7d714 100644
--- a/webext/manifest_base.json
+++ b/webext/manifest_base.json
@@ -1,5 +1,5 @@
 {
-  "manifest_version": 2,
+  "manifest_version": 3,
   "name": "Snowflake",
   "version": "0.6.3",
   "description": "__MSG_appDesc__",
@@ -9,12 +9,9 @@
     "96": "assets/toolbar-on-96.png"
   },
   "background": {
-    "scripts": [
-      "snowflake.js"
-    ],
-    "persistent": true
+    "service_worker": "snowflake.js"
   },
-  "browser_action": {
+  "action": {
     "default_icon": {
       "48": "assets/toolbar-on-48.png",
       "96": "assets/toolbar-on-96.png"

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the tor-commits mailing list