(tabId)
| 15 | |
| 16 | addOwnCommands({ |
| 17 | async NewScript(tabId) { |
| 18 | const tab = tabId >= 0 && await getTab(tabId) || {}; |
| 19 | const tabUrl = tab.url; |
| 20 | const url = injectableRe.test(tabUrl) && `${tabUrl.split(/[#?]/)[0]}*`; |
| 21 | const { host = 'example.org', domain } = url ? commands.GetTabDomain(url) : {}; |
| 22 | return newScript({ |
| 23 | url: url || `*://${host}/*`, |
| 24 | name: domain || '', |
| 25 | icon: tab.favIconUrl || '', |
| 26 | }); |
| 27 | }, |
| 28 | }); |
| 29 | |
| 30 | hookOptionsInit((changes, firstRun) => { |