Fixed chromium detection

This commit is contained in:
ManeraKai 2023-03-06 17:27:24 +03:00
parent e70f787c6d
commit a78e337f9e
No known key found for this signature in database
GPG Key ID: 5ABC31FFD562E337
2 changed files with 4 additions and 2 deletions

View File

@ -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");

View File

@ -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',