Skip to content

Commit

Permalink
feat: Migrate extension to Manifest v3
Browse files Browse the repository at this point in the history
  • Loading branch information
jsargiot committed Nov 20, 2024
1 parent 5a27212 commit 592ab7a
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 16 deletions.
2 changes: 1 addition & 1 deletion restman/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Free to use under the MIT license.
* https://raw.githubusercontent.com/jsargiot/restman/master/LICENSE
*/
chrome.browserAction.onClicked.addListener(function() {
chrome.action.onClicked.addListener(function() {
chrome.tabs.query({currentWindow: true, active: true}, function(tab) {
chrome.tabs.create( { "url": "index.html" } );
});
Expand Down
9 changes: 1 addition & 8 deletions restman/js/ui/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@
* https://raw.githubusercontent.com/jsargiot/restman/master/LICENSE
*/
$(document).ready(function(event) {
var details = chrome.app.getDetails(),
version;

version = details
? details["version"]
: "N/A";

var version = chrome.runtime.getManifest().version;
$('#VersionNumber').text("v" + version);
});

33 changes: 26 additions & 7 deletions restman/manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
{
"manifest_version": 2,
"manifest_version": 3,
"name": "RestMan",
"author": "Joaquin Sargiotto",
"description": "RESTMan is a browser extension to work on http requests.",
"version": "0.7.2",

"icons": {
"32": "img/icon32.png",
"64": "img/icon64.png"
},
"background": {"scripts": ["js/background.js"], "persistent": false},
"permissions": ["http://*/", "http://*/*", "https://*/", "https://*/*", "storage"],
"browser_action": {
"default_icon": "img/icon32.png",
"default_title": "RestMan"

"background": {
"service_worker": "js/background.js"
},

"permissions": [
"storage"
],

"host_permissions": [
"*://*/*"
],

"action": {
"default_title": "Default Title",
"default_icon": {
"32": "img/icon32.png",
"64": "img/icon64.png"
}
},

"incognito": "split",
"content_security_policy": "default-src 'self'; connect-src *; script-src 'self'; style-src 'self' * blob: data: 'unsafe-inline'; img-src 'self' * data:;"

"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self';"
}
}

0 comments on commit 592ab7a

Please sign in to comment.