Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: move action icon into URL bar #20

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,18 @@ const fetchPath = (pathname) => (url) => {
* @returns {number} Tab number.
*/
const setIcon = (tabId) => (path) => {
api.action.setIcon({
path: path,
tabId,
});
if (!api.pageAction) {
// Chrome doesn't support page actions
api.action.setIcon({
path: path,
tabId,
});
} else {
api.pageAction.setIcon({
path: path,
tabId,
});
}
return tabId;
};

Expand Down
10 changes: 9 additions & 1 deletion manifest/manifest_chrome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
{
"author": {
"email": "[email protected]"
},
"background": {
"service_worker": "background.js",
"type": "module"
},
"minimum_chrome_version": "92"
"minimum_chrome_version": "92",
"action": {
"default_title": "identinet Decentralized Identity Information",
"default_popup": "index.html",
"default_icon": "icons/favicon_48.png"
}
}
9 changes: 9 additions & 0 deletions manifest/manifest_firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,14 @@
"id": "[email protected]",
"strict_min_version": "109.0"
}
},
"page_action": {
"default_title": "identinet Decentralized Identity Information",
"default_popup": "index.html",
"default_icon": {
"19": "icons/favicon_19.png",
"38": "icons/favicon_38.png"
},
"show_matches": ["https://*/*"]
}
}
5 changes: 0 additions & 5 deletions manifest/manifest_shared.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@
"96": "icons/favicon_96.png",
"128": "icons/favicon_128.png"
},
"action": {
"default_title": "identinet Decentralized Identity Information",
"default_popup": "index.html",
"default_icon": "icons/favicon_48.png"
},
"permissions": [
"activeTab",
"tabs",
Expand Down
Binary file added public/icons/favicon_19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/icons/favicon_38.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.