From 56d43fb76c85f6ddb64469b8cdf7dbcf9ee1b11e Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Mon, 26 Aug 2024 16:19:58 +0800 Subject: [PATCH 01/11] host-ext: Automatic conversion to v3 Using https://github.com/GoogleChromeLabs/extension-manifest-converter --- host-ext/crouton/background.js | 12 ++++++------ host-ext/crouton/manifest.json | 25 ++++++++++++------------- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/host-ext/crouton/background.js b/host-ext/crouton/background.js index 7d0d6948a..43450ff2b 100644 --- a/host-ext/crouton/background.js +++ b/host-ext/crouton/background.js @@ -144,15 +144,15 @@ function refreshUI() { else if (active_) icon = "connected"; - chrome.browserAction.setIcon( + chrome.action.setIcon( {path: {19: icon + '-19.png', 38: icon + '-38.png'}} ); - chrome.browserAction.setTitle({title: 'crouton: ' + icon}); + chrome.action.setTitle({title: 'crouton: ' + icon}); - chrome.browserAction.setBadgeText( + chrome.action.setBadgeText( {text: windows_.length > 1 ? '' + (windows_.length-1) : ''} ); - chrome.browserAction.setBadgeBackgroundColor({color: '#2E822B'}); + chrome.action.setBadgeBackgroundColor({color: '#2E822B'}); var views = chrome.extension.getViews({type: "popup"}); for (var i = 0; i < views.length; views++) { @@ -787,9 +787,9 @@ chrome.runtime.getPlatformInfo(function(platforminfo) { }); } else { /* Disable the icon on non-Chromium OS. */ - chrome.browserAction.setTitle( + chrome.action.setTitle( {title: 'crouton is not available on this platform'} ); - chrome.browserAction.disable(); + chrome.action.disable(); } }); diff --git a/host-ext/crouton/manifest.json b/host-ext/crouton/manifest.json index ae3eb0afb..c6f19235f 100644 --- a/host-ext/crouton/manifest.json +++ b/host-ext/crouton/manifest.json @@ -1,6 +1,5 @@ { - "manifest_version": 2, - + "manifest_version": 3, "name": "crouton integration", "short_name": "crouton", "description": "Improves integration with crouton chroots.", @@ -9,16 +8,7 @@ "48": "icon-48.png", "128": "icon-128.png" }, - "offline_enabled": true, - "browser_action": { - "default_icon": { - "19": "disconnected-19.png", - "38": "disconnected-38.png" - }, - "default_popup": "popup.html", - "default_title": "crouton" - }, "background": { "page": "background.html" }, @@ -27,5 +17,14 @@ "clipboardWrite", "notifications", "storage" - ] -} + ], + "action": { + "default_icon": { + "19": "disconnected-19.png", + "38": "disconnected-38.png" + }, + "default_popup": "popup.html", + "default_title": "crouton" + }, + "content_security_policy": {} +} \ No newline at end of file From 18186db54d04b5c386e5511f500eba22b02eb6e2 Mon Sep 17 00:00:00 2001 From: Nicolas Boichat Date: Mon, 26 Aug 2024 17:04:24 +0800 Subject: [PATCH 02/11] host-ext: getViews is deprecated Remove that for now, so that the extension at least... loads. Also ignore background document for now --- host-ext/crouton/background.html | 1 - host-ext/crouton/background.js | 20 +++++++++++++++++--- host-ext/crouton/manifest.json | 7 ++++--- host-ext/crouton/popup.js | 4 +++- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/host-ext/crouton/background.html b/host-ext/crouton/background.html index ae5271ac7..9ee181554 100644 --- a/host-ext/crouton/background.html +++ b/host-ext/crouton/background.html @@ -7,7 +7,6 @@ -