ldenoue / yawas

Yawas Web and PDF Highlighter browser extension for Chrome and Firefox
MIT License
49 stars 12 forks source link

Promise rejected after context unloaded; res is undefined; Unchecked lastError #18

Closed peter-lyons-kehl closed 3 years ago

peter-lyons-kehl commented 3 years ago

In Firefox 92.0.1, new Yawas 7.3.4, under normal user pattern (after G. Bookmarks import; with using some privileged tabs - as I was disabling other extensions; the tabs I was switching among did not have any Yawas higlights, and I was not creating any new highlights):

Promise rejected after context unloaded: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved
yawas-content-script.js:543
    sendMessage moz-extension://e12bf03a-4cfd-4ae8-841d-3a08e00d7382/yawas-content-script.js:543

res is undefined yawas-content-script.js:239
    askForAnnotations moz-extension://e12bf03a-4cfd-4ae8-841d-3a08e00d7382/yawas-content-script.js:239
    response moz-extension://e12bf03a-4cfd-4ae8-841d-3a08e00d7382/yawas-content-script.js:545
    apply self-hosted:2736
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:626
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:855
    withLastError resource://gre/modules/ExtensionCommon.jsm:774
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:843
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope yawas-content-script.js:543
res is undefined yawas-content-script.js:239
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope yawas-content-script.js:543
res is undefined yawas-content-script.js:239
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope yawas-content-script.js:543
res is undefined yawas-content-script.js:239
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope yawas-content-script.js:543
res is undefined 2 yawas-content-script.js:239
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope 2 yawas-content-script.js:543
sendRemoveListener on closed conduit {7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}.1236950581248 ConduitsChild.jsm:108
    _send resource://gre/modules/ConduitsChild.jsm:108
    _send self-hosted:1279
    removeListener resource://gre/modules/ExtensionChild.jsm:663
    removeListener resource://gre/modules/ExtensionChild.jsm:891
    onChanged chrome://extensions/content/child/ext-storage.js:332
    removeListener resource://gre/modules/ExtensionCommon.jsm:2534
    revoke resource://gre/modules/ExtensionCommon.jsm:2556
    close resource://gre/modules/ExtensionCommon.jsm:2561
    unload resource://gre/modules/ExtensionCommon.jsm:922
    close resource://gre/modules/ExtensionContent.jsm:936
    destroyed resource://gre/modules/ExtensionContent.jsm:1014
    observe resource://gre/modules/ExtensionContent.jsm:1032
sendRemoveListener on closed conduit jid1-Om7eJGwA1U8Akg@jetpack.1236950581267 ConduitsChild.jsm:108
sendRemoveListener on closed conduit {7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}.1236950581329 ConduitsChild.jsm:108
sendRemoveListener on closed conduit jid1-Om7eJGwA1U8Akg@jetpack.1236950581348 ConduitsChild.jsm:108
Promise rejected after context unloaded: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved
2 yawas-content-script.js:543
    sendMessage moz-extension://e12bf03a-4cfd-4ae8-841d-3a08e00d7382/yawas-content-script.js:543
sendRemoveListener on closed conduit {7a7a4a92-a2a0-41d1-9fd7-1e92480d612d}.1236950581410 ConduitsChild.jsm:108
sendRemoveListener on closed conduit jid1-Om7eJGwA1U8Akg@jetpack.1236950581426 ConduitsChild.jsm:108
Promise rejected after context unloaded: Actor 'Conduits' destroyed before query 'RuntimeMessage' was resolved
yawas-content-script.js:543
res is undefined yawas-content-script.js:239
    askForAnnotations moz-extension://e12bf03a-4cfd-4ae8-841d-3a08e00d7382/yawas-content-script.js:239
    response moz-extension://e12bf03a-4cfd-4ae8-841d-3a08e00d7382/yawas-content-script.js:545
    apply self-hosted:2736
    applySafeWithoutClone resource://gre/modules/ExtensionCommon.jsm:626
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:855
    withLastError resource://gre/modules/ExtensionCommon.jsm:774
    wrapPromise resource://gre/modules/ExtensionCommon.jsm:843
Unchecked lastError value: Error: Promised response from onMessage listener went out of scope yawas-content-script.js:543

I'm following your GitHub repo. So if you commit anything, I'll install the extension locally and I'll test (hence not waiting for Mozilla's approval...).

ldenoue commented 3 years ago

@peter-kehl this happens when the extension gets reloaded. I added checks to handle when res is undefined.