Chrome extension: sendmessage response does not work

I try to code a web extension for Chrome. I have a popup.js and a background.js. In my popup I need information from the background.js. So I send a message with chrome.runtime.sendMessage to the background.js, to get a response. But the response doesn’t work. I know, there are so many threads here on stackoverflow with the same problem, but I really tried everything. In Firefox it works without any problemes. I used the ‘browser’ object there. In Chrome it doesn’t work. The response is undefined.

Do you have any idea what’s wrong with my code?


function handleResponse(response) {
  document.getElementById("gray").id = (`${response.response2}`);

function handleError(error) {
  console.log(`Error: ${error}`);

function notifyBackgroundPage(e) {
  var sending = chrome.runtime.sendMessage({
    greeting: "Message to background.js"
  sending.then(handleResponse, handleError);  

window.addEventListener("load", notifyBackgroundPage);


popuptext = "Response to popup.js";
colorid = "red";

chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
  console.log("background.js: " +

if (request.greeting){
  	response1: popuptext, 
  	response2: colorid
	return true;



  "manifest_version": 2,
  "name": "My Extension",
  "version": "0.5",
  "permissions": ["notifications"],

  "description": "This is my description",

  "icons": {
    "48": "icons/icon-48.png",
    "96": "icons/icon.svg"
	"background": {
    "scripts": ["background.js"],
    "persistent": true
  "browser_action": {
    "default_icon": {
      "16": "icons/page-16.png",
      "32": "icons/page-32.png"
    "default_popup": "popup/popup.html",
	  "browser_style": true


browser.webRequest.onBeforeRequest API not working in Edge extension

I have a problem with browser.webRequest.onBeforeRequest not being picked up by a Microsoft Edge browser extension.

Specifically, I have the following code in the extension:

browser.webRequest.onBeforeRequest.addListener(function(details) {
    console.log('DEBUG: onBeforeRequest - details = ', details);
}, { urls:['*://*/*'] });

and then I have a PHP script that reads:


However when I click through to the PHP script, the extension only picks up google but not the path of the PHP script. Note that on Chrome and Opera it picks up the path of the PHP script as I want and expect.

Any ideas as to what Edge is doing here? I have tried adding “blocking” but that makes no difference.



Opera extension manifest file

I have created an Opera extension, but have a question about the “manifest.json” file.

Specifically, I’m not sure what version I should put in “minimum_opera_version”.

According to the documentation (which all points to the chrome developer API), based on the API calls I make the minimum version is Chrome 26.

However what version of Opera is that? How can I figure out what minimum version of Opera the extension requires?

Slow webextension issue on Firefox 56 on Windows

I’m currently developing a new version of the my extension for chrome and Firefox using the Webextensions API.

My problem is that after the latest Firefox update (Firefox 56) my extension is extremely slow on windows. I don’t have that issue on macOS with Firefox 56. Opening the extension’s popup is very slow as is injecting scripts in web pages.

With Firefox 55 and prior versions my extension works fine on Windows and macOS. I tried the beta of Firefox 57 and again my extension works wonders on macOS and Windows.

My extension is quiet complexe. It uses the sendMessage API to communicate between the background, extension popup and other injected scripts. It also uses the tabs API to name a few.

So I tried multiple things to find out why the extension is slow only on Windows with Firefox 56… I did mock the data sent by the background to the popup to eliminate the sendMessage factor, and my popup opened quickly. But I still had slowness issues with my scripts. I tried to remove the few calls to the local storage but it didn’t change anything.

So this is why I’m contacting you, I’m running out of ideas… I really don’t understand why I have this problem only on Windows with Firefox 56… I tried to gather some information on the version changelog, but I found nothing relevant.

Any help would be appreciated!