File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { urlMatchesPattern } from "./utils/urlMatchPattern.js" ;
2-
2+ /* global chrome */
33document . addEventListener ( "DOMContentLoaded" , async ( ) => {
44 // Apply theme first
55 await applyThemeFromSettings ( ) ;
@@ -214,6 +214,13 @@ document.addEventListener("DOMContentLoaded", async () => {
214214 const [ tab ] = await chrome . tabs . query ( { active : true , currentWindow : true } ) ;
215215 if ( ! tab ?. id ) return ;
216216
217+ //skip exacution on browser pages
218+ const restrictedPatterns = / ^ ( c h r o m e | e d g e | a b o u t ) : \/ \/ / i;
219+ if ( restrictedPatterns . test ( tab . url || "" ) ) {
220+ menuSection . style . display = "none" ;
221+ return ;
222+ }
223+
217224 const [ { result : commands = [ ] } ] = await chrome . scripting . executeScript ( {
218225 target : { tabId : tab . id } ,
219226 world : "MAIN" ,
@@ -225,7 +232,6 @@ document.addEventListener("DOMContentLoaded", async () => {
225232 return ;
226233 }
227234
228- // Deduplicate commands with same caption from same scriptId
229235 const unique = [ ] ;
230236 const seen = new Set ( ) ;
231237 commands . forEach ( ( c ) => {
You can’t perform that action at this time.
0 commit comments