0

I have read tonns of articles and I'm near by to say, that what I want to do is not possible. But maybe I have overlooked an article with the solution.

We have a webclient for intranet solutions which is not bound to a domain I know. Our customers install the webclient on their server and give him a domain they like in their company.

Now we want to develop a WebExtension to have further possibilities on filesystem and other system mechanismen. We do not want to manipulate the webclient with this WebExtension. The webclient should send messages with commands to the WebExtension and they should be processed.

The only solution I found is. WebClient -> content_scripts -> background_scripts. The content_scripts can forward the messages to the background_scripts. The problem is, that content_scripts must match a domain and we do not know the domain were our customers install the webclient

"content_scripts": [
  {
    "matches": ["*://*.mozilla.org/*"],
    "js": ["jquery.js", "content-script.js"]
  }
]

Is it possible to send a message like

browser.runtime.sendMessage()

Directly from an webpage script to an WebExtension? Maybe if one know the WebExtension unique id? Or are there other solutions for the problem not knowing the domain a webpage runs?

Thanks René

Novan
  • 11
  • 1
  • Add an input field in your extension config dialog to enter the domain and then use it in chrome.webNavigation.onCommitted listener to run the content script via chrome.tabs.executeScript – wOxxOm Jan 09 '18 at 18:12
  • Have you tried setting ```"matches": ["http://*/*", "https://*/*"]``` to match all domains? – acesmndr Jan 10 '18 at 11:10

0 Answers0