diff --git a/src/assets/javascripts/services.js b/src/assets/javascripts/services.js index 5321b76..3481273 100644 --- a/src/assets/javascripts/services.js +++ b/src/assets/javascripts/services.js @@ -1,5 +1,6 @@ import utils from "./utils.js" +const isChrome = browser.runtime.getBrowserInfo === undefined window.browser = window.browser || window.chrome let config, options @@ -807,7 +808,7 @@ async function copyRaw(url, test) { const newUrl = await reverse(url) if (newUrl) { if (!test) { - if (window.browser) { + if (!isChrome) { navigator.clipboard.writeText(newUrl) } else { var copyFrom = document.createElement("textarea"); diff --git a/src/pages/background/background.js b/src/pages/background/background.js index b3c3a9a..6110e78 100644 --- a/src/pages/background/background.js +++ b/src/pages/background/background.js @@ -4,6 +4,7 @@ import generalHelper from "../../assets/javascripts/general.js" import utils from "../../assets/javascripts/utils.js" import servicesHelper from "../../assets/javascripts/services.js" +const isChrome = browser.runtime.getBrowserInfo === undefined window.browser = window.browser || window.chrome browser.runtime.onInstalled.addListener(async details => { @@ -139,7 +140,7 @@ browser.contextMenus.create({ contexts: ["link"], }) -if (window.browser) { +if (!isChrome) { browser.contextMenus.create({ id: "redirectBookmark", title: 'Redirect',