port to firefox

This commit is contained in:
Tijl 2023-02-10 11:20:41 +01:00
parent daa7f81c7a
commit f39b89efcb
3 changed files with 17 additions and 14 deletions

View File

@ -0,0 +1 @@
{}

View File

@ -1,15 +1,17 @@
{
"name": "redirect",
"version": "0.1.0",
"description": "create a redirect directly",
"permissions": ["storage", "tabs"],
"background": {
"service_worker": "background.js"
},
"action": {
"default_icon": "assets/my-icon.png",
"default_title": "redirect",
"default_popup": "popup.html"
},
"manifest_version": 3
"browser_action": {
"default_title": "redirect",
"default_popup": "popup.html"
},
"content_security_policy": "script-src 'self' https://example.com; object-src 'self'",
"default_locale": "en",
"description": "create a redirect directly",
"manifest_version": 2,
"name": "redirect",
"page_action": {
"default_title": "redirect",
"default_popup": "popup.html"
},
"permissions": ["webNavigation", "tabs"],
"version": "0.1"
}

View File

@ -1,5 +1,5 @@
function newRedirect () {
chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => {
browser.tabs.query({currentWindow: true, active: true}, tabs => {
let currentUrl = tabs[0].url;
const url = `${config.shlinkUrl}/rest/v3/short-urls`;
let sendData = {