Fixed bookmarks context menu not working https://github.com/libredirect/libredirect/issues/646
This commit is contained in:
parent
544d45a912
commit
5757aa56d2
@ -807,7 +807,7 @@ async function copyRaw(url, test) {
|
||||
const newUrl = await reverse(url)
|
||||
if (newUrl) {
|
||||
if (!test) {
|
||||
if (!window.chrome) {
|
||||
if (window.browser) {
|
||||
navigator.clipboard.writeText(newUrl)
|
||||
} else {
|
||||
var copyFrom = document.createElement("textarea");
|
||||
|
@ -139,7 +139,7 @@ browser.contextMenus.create({
|
||||
contexts: ["link"],
|
||||
})
|
||||
|
||||
if (!window.chrome) {
|
||||
if (window.browser) {
|
||||
browser.contextMenus.create({
|
||||
id: "redirectBookmark",
|
||||
title: 'Redirect',
|
||||
@ -256,14 +256,13 @@ browser.contextMenus.onClicked.addListener(async (info) => {
|
||||
const url = new URL(bookmarks[0].url)
|
||||
const newUrl = await servicesHelper.reverse(url)
|
||||
if (newUrl) {
|
||||
browser.tabs.update({ url: newUrl }, tab => {
|
||||
browser.tabs.create({ url: newUrl }, tab => {
|
||||
tabIdRedirects[tab.id] = false
|
||||
})
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user