-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enh(web-ext): Add protocol handler in extension manifest, for firefox
- Loading branch information
Showing
13 changed files
with
350 additions
and
215 deletions.
There are no files selected for viewing
Submodule desktop
updated
from 70444a to 532bd7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Manifest V3 migration | ||
|
||
This folder `chrome-ext` has been created in order to prepare to Manifest V3 format. | ||
|
||
This is working well for Chrome, but not yet for Firefox. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Add browser actions, for WebExtension | ||
* (e.g. to open Cesium in a tab, when integrated as a Firefox extension). | ||
* | ||
* See https://forum.duniter.org/t/premiere-version-du-module-cesium-pour-firefox/6944 | ||
* | ||
**/ | ||
var browser, chrome; | ||
|
||
browser = browser || chrome; | ||
|
||
var action = browser.browserAction || (chrome && chrome.action); | ||
|
||
var browserExtensionRequirements = browser.tabs && action && action.onClicked; | ||
|
||
// If integrated as a browser extension | ||
if (browserExtensionRequirements) { | ||
console.debug("[extension] Initializing..."); | ||
|
||
/** | ||
* Open Cesium in a new browser's tab | ||
*/ | ||
function openInTab() { | ||
console.debug("[extension] Opening Cesium...") | ||
browser.tabs.create({ | ||
url: "index.html" | ||
}); | ||
} | ||
|
||
// Adding browser action | ||
action.onClicked.addListener(openInTab); | ||
|
||
// FIXME: finish this code | ||
function checkNotifications() { | ||
console.debug("[extension] Checking for notifications..."); | ||
|
||
action.setBadgeText({ | ||
text: '0' | ||
}); | ||
action.setBadgeBackgroundColor({ | ||
color: '#387EF5' // = $positive color - see the SCSS theme | ||
}); | ||
|
||
// Loop, after a delay | ||
setTimeout(function() { | ||
checkNotifications(); | ||
}, 60 * 1000 /*1min*/); | ||
} | ||
//checkNotifications(); | ||
} | ||
else { | ||
console.error("[extension] Cannot init extension: missing some API requirements (action or tabs"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"manifest_version": 2, | ||
"name": "Cesium", | ||
"version": "1.7.12", | ||
"description": "Cesium Wallet for Ğ1 libre currency", | ||
"icons": { | ||
"32": "img/logo_32px.png", | ||
"60": "img/logo_60px.png", | ||
"96": "img/logo_96px.png", | ||
"144": "img/logo_144px.png", | ||
"192": "img/logo.svg" | ||
}, | ||
"permissions": [ | ||
"storage" | ||
], | ||
"host_permissions": [ | ||
"file:///*", | ||
"*://*/*" | ||
], | ||
"background": { | ||
"service_worker": "background.js", | ||
"scripts": ["background.js"] | ||
}, | ||
"browser_action" : { | ||
"default_icon": { | ||
"32": "img/logo_32px.png", | ||
"60": "img/logo_60px.png", | ||
"96": "img/logo_96px.png", | ||
"128": "img/logo_128px.png" | ||
} | ||
}, | ||
"action": { | ||
"default_icon": { | ||
"32": "img/logo_32px.png", | ||
"60": "img/logo_60px.png", | ||
"96": "img/logo_96px.png", | ||
"144": "img/logo_144px.png", | ||
"192": "img/logo.svg" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,47 @@ | ||
{ | ||
"manifest_version": 3, | ||
"short_name": "Cesium", | ||
"name": "Cesium", | ||
"manifest_version": 1, | ||
"version": "1.7.12", | ||
"default_locale": "fr", | ||
"description": "Cesium Wallet for Ğ1 libre currency", | ||
"icons": { | ||
"32": "img/logo_32px.png", | ||
"96": "img/logo_96px.png", | ||
"144": "img/logo_144px.png", | ||
"192": "img/logo.svg" | ||
}, | ||
"permissions": [ | ||
"storage" | ||
], | ||
"host_permissions": [ | ||
"file:///*" | ||
], | ||
"theme": { | ||
"colors": { | ||
"frame": "#1a237e", | ||
"toolbar": "#1a237e", | ||
"ntp_background": "#1a237e", | ||
"ntp_text": "#1a237e", | ||
"button_background": "#1a237e" | ||
"icons": [ | ||
{ | ||
"src": "img/logo_32px.png", | ||
"sizes": "32x32", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "img/logo_96px.png", | ||
"sizes": "96x96", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "img/logo_144px.png", | ||
"sizes": "144x144", | ||
"type": "image/png" | ||
}, | ||
{ | ||
"src": "img/logo.svg", | ||
"sizes": "192x192", | ||
"type": "image/svg" | ||
} | ||
}, | ||
], | ||
"background_color": "#1a237e", | ||
"theme_color": "black", | ||
"dir": "ltr", | ||
"start_url": "/#/app/home", | ||
"display": "standalone", | ||
"protocol_handlers": [ | ||
{ | ||
"protocol": "june", | ||
"uriTemplate": "/#/app/home?uri=%s" | ||
"name": "Ğ1", | ||
"uriTemplate": "#/app/home?uri=%s" | ||
}, | ||
{ | ||
"protocol": "web+june", | ||
"uriTemplate": "/#/app/home?uri=%s" | ||
"name": "web Ğ1", | ||
"uriTemplate": "#/app/home?uri=%s" | ||
} | ||
] | ||
} |
Oops, something went wrong.