Skip to content

Commit

Permalink
Fixed reverse tab for context menu for chromium
Browse files Browse the repository at this point in the history
  • Loading branch information
ManeraKai committed Mar 5, 2023
1 parent c5cd80d commit 10b4fd9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/assets/javascripts/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ window.browser = window.browser || window.chrome
let exceptions

function isException(url) {
if (url !== undefined) {
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 && url) {
if (exceptions.url) for (const item of exceptions.url) if (item == url.href) return true
if (exceptions.regex) for (const item of exceptions.regex) if (new RegExp(item).test(url.href)) return true
}
return false
}
Expand Down
8 changes: 6 additions & 2 deletions src/pages/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ browser.contextMenus.onClicked.addListener(async (info) => {
return
}
case 'copyReverseTab': {
const url = new URL(info.pageUrl)
servicesHelper.copyRaw(url)
browser.tabs.query({ active: true, currentWindow: true }, async tabs => {
if (tabs[0].url) {
const url = new URL(tabs[0].url)
servicesHelper.copyRaw(url)
}
})
return
}
case 'reverseTab': {
Expand Down

0 comments on commit 10b4fd9

Please sign in to comment.