Skip to content

Commit 705e3d2

Browse files
authored
Merge pull request #10 from AmoabaKelvin/feat/redirect-to-freedium-onIcon-click
feat: redirect to the freedium website when the extension image is clicked.
2 parents 40ba294 + b8a7570 commit 705e3d2

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

chromium/background.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
chrome.action.onClicked.addListener((tab) => {
3+
// get the current active tab and then redirect the link to freedium
4+
chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {
5+
var activeTab = tabs[0];
6+
var link = activeTab.url;
7+
8+
chrome.tabs.create({
9+
url: `https://freedium.cfd/${link}`
10+
})
11+
});
12+
})

chromium/manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,8 @@
1313
"permissions": ["activeTab", "storage", "declarativeContent"],
1414
"action": {
1515
"default_icon": "image.png"
16+
},
17+
"background": {
18+
"service_worker": "background.js"
1619
}
1720
}

0 commit comments

Comments
 (0)