Skip to content
This repository has been archived by the owner on Dec 28, 2022. It is now read-only.

Commit

Permalink
Fix regression from PR #272
Browse files Browse the repository at this point in the history
  • Loading branch information
wiiaboo committed Feb 2, 2021
1 parent 3e0680a commit b34449b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions webextension/background.js
Expand Up @@ -17,17 +17,17 @@ function get_target_url(info) {
return info.linkUrl;
} else if (info.srcUrl) { // Is the target an img, audio, or video element?
return info.srcUrl;
} else if (info.frameUrl) { // Is the element an iframe?
} else if (info.frameUrl && info.viewType !== 'sidebar') { // Is the element an iframe and not in a sidebar?
return info.frameUrl;
} else if (info.selectionText && /^(?:https?|ftp):/i.test(info.selectionText)) { // Is there an URL selected?
return info.selectionText;
}
return info.pageUrl;
}

function context_menu_clicked(info, tab) {
function context_menu_clicked(info) {
let browser_id = parseInt(info.menuItemId.substring(8), 10);
let url = tab ? tab.url : get_target_url(info);
let url = get_target_url(info);
if ('modifiers' in info && info.modifiers.includes('Ctrl')) {
url = null;
}
Expand Down

0 comments on commit b34449b

Please sign in to comment.