Fixed chromium detection
This commit is contained in:
parent
e70f787c6d
commit
a78e337f9e
|
@ -1,5 +1,6 @@
|
||||||
import utils from "./utils.js"
|
import utils from "./utils.js"
|
||||||
|
|
||||||
|
const isChrome = browser.runtime.getBrowserInfo === undefined
|
||||||
window.browser = window.browser || window.chrome
|
window.browser = window.browser || window.chrome
|
||||||
|
|
||||||
let config, options
|
let config, options
|
||||||
|
@ -807,7 +808,7 @@ async function copyRaw(url, test) {
|
||||||
const newUrl = await reverse(url)
|
const newUrl = await reverse(url)
|
||||||
if (newUrl) {
|
if (newUrl) {
|
||||||
if (!test) {
|
if (!test) {
|
||||||
if (window.browser) {
|
if (!isChrome) {
|
||||||
navigator.clipboard.writeText(newUrl)
|
navigator.clipboard.writeText(newUrl)
|
||||||
} else {
|
} else {
|
||||||
var copyFrom = document.createElement("textarea");
|
var copyFrom = document.createElement("textarea");
|
||||||
|
|
|
@ -4,6 +4,7 @@ import generalHelper from "../../assets/javascripts/general.js"
|
||||||
import utils from "../../assets/javascripts/utils.js"
|
import utils from "../../assets/javascripts/utils.js"
|
||||||
import servicesHelper from "../../assets/javascripts/services.js"
|
import servicesHelper from "../../assets/javascripts/services.js"
|
||||||
|
|
||||||
|
const isChrome = browser.runtime.getBrowserInfo === undefined
|
||||||
window.browser = window.browser || window.chrome
|
window.browser = window.browser || window.chrome
|
||||||
|
|
||||||
browser.runtime.onInstalled.addListener(async details => {
|
browser.runtime.onInstalled.addListener(async details => {
|
||||||
|
@ -139,7 +140,7 @@ browser.contextMenus.create({
|
||||||
contexts: ["link"],
|
contexts: ["link"],
|
||||||
})
|
})
|
||||||
|
|
||||||
if (window.browser) {
|
if (!isChrome) {
|
||||||
browser.contextMenus.create({
|
browser.contextMenus.create({
|
||||||
id: "redirectBookmark",
|
id: "redirectBookmark",
|
||||||
title: 'Redirect',
|
title: 'Redirect',
|
||||||
|
|
Loading…
Reference in New Issue