[extensions-web] Don't use InstallTrigger to detect Firefox and install xpi
- From: Yuri Konotopov <ykonotopov src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [extensions-web] Don't use InstallTrigger to detect Firefox and install xpi
- Date: Fri, 1 Jul 2022 06:32:38 +0000 (UTC)
commit 1bcdec2a572924d83524167f585e3f68a70cb685
Author: Ksenia Berezina <kberezina mozilla com>
Date: Thu Jun 30 23:51:43 2022 -0400
Don't use InstallTrigger to detect Firefox and install xpi
sweettooth/static/js/browser_extension.js | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/sweettooth/static/js/browser_extension.js b/sweettooth/static/js/browser_extension.js
index a7e5265..af7778f 100644
--- a/sweettooth/static/js/browser_extension.js
+++ b/sweettooth/static/js/browser_extension.js
@@ -13,7 +13,7 @@ IS_CHROME = (typeof(chrome) !== 'undefined' && (
typeof(chrome.runtime) !== 'undefined' ||
typeof(chrome.csi) !== 'undefined'
));
-IS_FIREFOX = (typeof(InstallTrigger) !== 'undefined');
+IS_FIREFOX = CSS.supports("-moz-appearance: none");
IS_OPERA = (typeof(opr) !== 'undefined');
function browser_extension_install() {
@@ -30,16 +30,7 @@ function browser_extension_install() {
}
else if(IS_FIREFOX)
{
- // https://developer.mozilla.org/en-US/docs/Web/API/InstallTrigger/install
- InstallTrigger.install({
- 'GNOME Shell integration': {
- 'URL':
'https://addons.mozilla.org/firefox/downloads/latest/gnome-shell-integration/platform:2/addon-751081-latest.xpi'
- }
- }, function(url, status) {
- if (status == 0) {
- reload_page();
- }
- });
+
window.location.assign('https://addons.mozilla.org/firefox/downloads/latest/gnome-shell-integration/platform:2/addon-751081-latest.xpi');
}
else if (IS_CHROME)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]