opera-extension

How to determine in which browser your extension background script is executing?

こ雲淡風輕ζ 提交于 2019-11-29 08:24:48
I'm talking about Chrome extensions, Firefox WebExtensions, Edge extensions... In a background script, not a content script, is there a clear way to know which browser I am using? I need to do different operations for different browsers. Yes, navigator.userAgent can be useful, but it's not very clear . Is there any extension API that can be used to do this? Something like, chrome.extension.browserType . (Of course, this one doesn't really exist..) Makyen There is no specific API to detect which browser is currently being used. One of the benefits of the major browsers moving to support a

Match pattern for all Google search pages

倖福魔咒の 提交于 2019-11-28 09:18:55
问题 I'm developing an extension which will perform a certain action on all Google search URLs - but not on other websites or Google pages. In natural language the match pattern is: Any protocol ( '*://' ) Any subdomain or none ( 'www' or '' ) The domain string must equal 'google' Any TLD including three-letter TLDs (e.g. '.com' ) and multi-part country TLDs (e.g. '.co.uk' ) The first 8 letters of the path must equal '/search?' Many people say 'to match all google search pages use "*://*.google

How to determine in which browser your extension background script is executing?

╄→尐↘猪︶ㄣ 提交于 2019-11-28 01:50:24
问题 I'm talking about Chrome extensions, Firefox WebExtensions, Edge extensions... In a background script, not a content script, is there a clear way to know which browser I am using? I need to do different operations for different browsers. Yes, navigator.userAgent can be useful, but it's not very clear . Is there any extension API that can be used to do this? Something like, chrome.extension.browserType . (Of course, this one doesn't really exist..) 回答1: There is no specific API to detect which