File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed
Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,9 @@ window.browser = window.browser || window.chrome
77let exceptions
88
99function isException ( url ) {
10- if ( url !== undefined ) {
11- for ( const item of exceptions . url ) if ( item == url . href ) return true
12- for ( const item of exceptions . regex ) if ( new RegExp ( item ) . test ( url . href ) ) return true
10+ if ( exceptions && url ) {
11+ if ( exceptions . url ) for ( const item of exceptions . url ) if ( item == url . href ) return true
12+ if ( exceptions . regex ) for ( const item of exceptions . regex ) if ( new RegExp ( item ) . test ( url . href ) ) return true
1313 }
1414 return false
1515}
Original file line number Diff line number Diff line change @@ -176,8 +176,12 @@ browser.contextMenus.onClicked.addListener(async (info) => {
176176 return
177177 }
178178 case 'copyReverseTab' : {
179- const url = new URL ( info . pageUrl )
180- servicesHelper . copyRaw ( url )
179+ browser . tabs . query ( { active : true , currentWindow : true } , async tabs => {
180+ if ( tabs [ 0 ] . url ) {
181+ const url = new URL ( tabs [ 0 ] . url )
182+ servicesHelper . copyRaw ( url )
183+ }
184+ } )
181185 return
182186 }
183187 case 'reverseTab' : {
You can’t perform that action at this time.
0 commit comments