Fixed reverse tab for context menu for chromium
This commit is contained in:
parent
c5cd80da59
commit
10b4fd9601
|
@ -7,9 +7,9 @@ window.browser = window.browser || window.chrome
|
||||||
let exceptions
|
let exceptions
|
||||||
|
|
||||||
function isException(url) {
|
function isException(url) {
|
||||||
if (url !== undefined) {
|
if (exceptions && url) {
|
||||||
for (const item of exceptions.url) if (item == url.href) return true
|
if (exceptions.url) for (const item of exceptions.url) if (item == url.href) return true
|
||||||
for (const item of exceptions.regex) if (new RegExp(item).test(url.href)) return true
|
if (exceptions.regex) for (const item of exceptions.regex) if (new RegExp(item).test(url.href)) return true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -176,8 +176,12 @@ browser.contextMenus.onClicked.addListener(async (info) => {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case 'copyReverseTab': {
|
case 'copyReverseTab': {
|
||||||
const url = new URL(info.pageUrl)
|
browser.tabs.query({ active: true, currentWindow: true }, async tabs => {
|
||||||
|
if (tabs[0].url) {
|
||||||
|
const url = new URL(tabs[0].url)
|
||||||
servicesHelper.copyRaw(url)
|
servicesHelper.copyRaw(url)
|
||||||
|
}
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
case 'reverseTab': {
|
case 'reverseTab': {
|
||||||
|
|
Loading…
Reference in New Issue