diff --git a/main.js b/main.js index cc8a53a..d5290a2 100644 --- a/main.js +++ b/main.js @@ -1,3 +1,6 @@ -chrome.browserAction.onClicked.addListener(function(tab) { - chrome.tabs.executeScript({file: "fullscreen.js"}); +chrome.action.onClicked.addListener(function(tab) { + chrome.scripting.executeScript({ + target: {tabId: tab.id}, + files: ["fullscreen.js"] + }); }); diff --git a/manifest.json b/manifest.json index 6f647fe..4850374 100644 --- a/manifest.json +++ b/manifest.json @@ -1,13 +1,14 @@ { - "manifest_version": 2, + "manifest_version": 3, "name": "Fullscreen", - "version": "0.0.2", + "version": "0.0.3", "description": "Fullscreen extension for device without keyboard", - "permissions": ["activeTab"], - "browser_action":{}, + "permissions": ["activeTab", "scripting"], + "action": { + "default_title": "Click to fullscreen" + }, "background": { - "scripts": ["main.js"], - "persistent": false + "service_worker": "main.js" } }