Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Promised response from onMessage listener went out of scope #5066

Closed
alanmels opened this issue Apr 24, 2021 · 19 comments
Closed

Error: Promised response from onMessage listener went out of scope #5066

alanmels opened this issue Apr 24, 2021 · 19 comments

Comments

@alanmels
Copy link

alanmels commented Apr 24, 2021

Description of the bug

A freshly installed Backdrop website is giving the following error on Firefox's Developer Tool inspector:

Error: Promised response from onMessage listener went out of scope chrome.js:88:30

The line 88 looks as:

chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {

and the function - as:

app.on = {
  "management": function (callback) {
    chrome.management.getSelf(callback);
  },
  "uninstalled": function (url) {
    chrome.runtime.setUninstallURL(url, function () {});
  },
  "installed": function (callback) {
    chrome.runtime.onInstalled.addListener(function (e) {
      app.storage.load(function () {
        callback(e);
      });
    });
  },
  "startup": function (callback) {
    chrome.runtime.onStartup.addListener(function (e) {
      app.storage.load(function () {
        callback(e);
      });
    });
  },
  "message": function (callback) {
    chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) {
      app.storage.load(function () {
        callback(request, sender, sendResponse);
      });
      /*  */
      return true;
    });
  }
};

The whole file can be seen by pasting this to your Firefox's address bar:

view-source:moz-extension://b5848846-96c4-0d4c-9546-fc70d71c8daf/lib/chrome.js

Steps To Reproduce

To reproduce the behavior:

  1. Using Firefox browser open a clean Backdrop site with all the default settings.
  2. Right-click anywhere on Backdrop site's page, select Inspect.
  3. Just leave the Inspector for a while (about 30 seconds) and the reported error will show.

Additional information

Some entries beginning from comment #42 and further down could be relevant.

@alanmels
Copy link
Author

The outcome of the step 3 is not guaranteed as testing on another Backrop website gave the same error much later and probably as a result of hovering on different elements on the website. Not sure which one exactly tigers the error, but could be hovering the main navigation menu block.

@indigoxela
Copy link
Member

Does Backdrop have anything to do with this? I'm not sure, because chrome.js is part of Firefox, not Backdrop.

@alanmels What's your Firefox version?

@alanmels
Copy link
Author

Does Backdrop have anything to do with this? I'm not sure, because chrome.js is part of Firefox, not Backdrop.

Somehow, they addressed this issue on https://www.drupal.org/project/linkit/issues/2886455#comment-14042215 without touching Firefox.

@alanmels What's your Firefox version?

The newest:

Screen Shot 2021-04-25 at 10 37 55 AM

@klonos
Copy link
Member

klonos commented Apr 25, 2021

I did a search on https://www.drupal.org/project/linkit/issues/2886455 for "firefox" and "chrome.js" and nothing came up @alanmels 🤔 ...wrong link?

@alanmels
Copy link
Author

alanmels commented Apr 25, 2021

I did a search on https://www.drupal.org/project/linkit/issues/2886455 for "firefox" and "chrome.js" and nothing came up @alanmels 🤔 ...wrong link?

They are not discussing particularly Firefox or chrome.js, but the same error. Please read from comment 42.

Aside from all, could you please confirm you can replicate the error or is it just me?

@indigoxela
Copy link
Member

indigoxela commented Apr 26, 2021

Aside from all, could you please confirm you can replicate the error or is it just me?

I can't reproduce. Could it be that some FF plugin interferes? Also, I don't know what sort of bug this could be. Is there any problem on your Backdrop site besides that console nagging?

The Drupal issue you referred to handles totally different stuff (Linkit module and entity translation).

@klonos
Copy link
Member

klonos commented Apr 26, 2021

@alanmels I also wasn't able to reproduce on latest MacOS, initially with FF v87, then after upgrading to v88.

I used a fresh installation of Backdrop via https://backdropcms.org/demo, and switched to "Console" while inspecting the home page. I waited more than a couple of mins each time, but the only error in the console was this:

This page uses the non standard property “zoom”. Consider using calc() in the relevant property values, or using “transform” along with “transform-origin: 0 0”.

I should note that:

  • I was logged into the Backdrop site as user1 while inspecting
  • the only extension installed in FF is Adblock Plus

@laryn
Copy link
Contributor

laryn commented Apr 26, 2021

This page uses the non standard property “zoom”.

Just wanted to note this has been raised here: #4276

@prettydiff
Copy link

I just found this issue from search engine results. I am getting the same error messaging on an unrelated project.

It appears, according to Mozilla, to be error messaging about missed events in a browser extension.: https://bugzilla.mozilla.org/show_bug.cgi?id=1643186

I suggest disabling all your Firefox extensions and then attempting to reproduce the error.

@klonos
Copy link
Member

klonos commented May 31, 2021

Thanks for taking the time to chime in @prettydiff 🙏🏼

@alanmels do you agree that this is browser-related? We had nobody else report this, and we cannot reproduce it.

@yesminee
Copy link

I am facing same problem here, using ajax to transfer some js variables to the backend raises this bug.

@indigoxela
Copy link
Member

I am facing same problem here...

@yesminee have you already tried to disable all browser extensions? Our conclusion so far is, that the problem isn't directly related to Backdrop, but has something to do with browser internals.

@izmeez
Copy link

izmeez commented Oct 20, 2023

I am experiencing the same in Firefox developer tools. I don't spend all my time with that open so who knows it may be happening all the time. Nonetheless, I followed advice to use another browser and in the case of Brave (a chrome variant) I see a different message:

Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform
A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.
To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.
Note that for performance reasons, only the first access to one of the properties is shown.

I am not sure if the two are related or if this is a separate issue?

@izmeez
Copy link

izmeez commented Oct 20, 2023

The following suggests the issue on Firefox may be related to Screenshot components,
https://bugzilla.mozilla.org/show_bug.cgi?id=1643186#c12

@alanmels
Copy link
Author

@alanmels do you agree that this is browser-related? We had nobody else report this, and we cannot reproduce it.

Sorry for missing this question, @klonos. To say frankly, I moved on and not sure if it was completely browser issue or some combination of browser and Backdrop's response to what browser was expecting. I don't mind if you close the issue.

@klonos
Copy link
Member

klonos commented Oct 20, 2023

Since @izmeez is reporting this happening to him as well, lets keep the issue open to see if we can figure things out.

@izmeez can you please try testing the same in an incognito session? (assuming that browser extensions are not loading in incognito in Firefox - which is how things work in Chrome)

@izmeez
Copy link

izmeez commented Oct 20, 2023

I have resolved the Firefox issue: In my case it was directly related to the Awesome screenshot extension. Disabling that one extension eliminates the issue in Firefox. I realized it might be this because in the past I noticed that extension would occasionally kick in with a keyboard shortcut combined with the comment in the Firefox queue that it may be related to Screenshot components. This is great because I don't use that extension anyway, it's a hangover from the past. I much prefer the Nimbus extension.

My observation may lend support to the view it is an extension issue, just which one may be hard to tease out for each person.

Maybe, the other observation apparent in Chrome should be a new issue?

@klonos
Copy link
Member

klonos commented Oct 21, 2023

Off-topic: my favorite open source screenshot/screen-recording software that aren't browser extensions:

@izmeez
Copy link

izmeez commented Oct 26, 2023

@klonos Thanks for suggestions. I downloaded flameshot and may give it a try but I really like Nimbus for browser screen captures. It can capture part or all of the page including scroll and supports annotations. Very useful.

As for this thread I am inclined to close this issue. Just hope everyone has had a chance to see that it can be resolved with removing the offending browser extension.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants