M-Reimer / undoclosetab

Undo Close Tab Add-on for Firefox
GNU General Public License v3.0
91 stars 16 forks source link

Addon no longer works because of Firefox profile corruption #38

Open Homer-Sim opened 5 years ago

Homer-Sim commented 5 years ago

Hello,

I loved your add on. But for any reason it is not working when I am clicking the icon nor the context list by right click on a tab as used,

I already tried to uninstall and reinstall without improvement.

Any ideas?

M-Reimer commented 5 years ago

Seems like the same issue as https://github.com/M-Reimer/undoclosetab/issues/37 Maybe this will help, but please have a look at the list about what this will actually do: https://support.mozilla.org/en-US/kb/refresh-firefox-reset-add-ons-and-settings And please report back if you have any success with this.

Homer-Sim commented 5 years ago

Hmmm but I do not want to loose my settings

M-Reimer commented 5 years ago

The only other alternative is to start over with an completely new profile.

This is some "Firefox thing" that profiles can get corrupted. I can't reproduce these bugs as I never had this problem so far. And many other users also don't have any problems.

Maybe just create a backup of your profile and then try to delete files in the profile that may be related to this. If someone would come up with a possible solution, then a workaround could be documented.

M-Reimer commented 5 years ago

Maybe someone with this issue could check out the "browser console" for error messages. You can get it using the shortcut "Ctrl + Shift + J" Will leave this one open now to have something to reference any future issue to. I can not work at all at this one if noone offers to help. I never had this problem and I don't have access to a profile with this problem.

Homer-Sim commented 5 years ago

This after clicking the icon : `entry is undefined ext-browser.js:833 convertFromSessionStoreClosedData chrome://browser/content/parent/ext-browser.js:833:7 convertFromSessionStoreClosedData/result.tabs< chrome://browser/content/parent/ext-browser.js:1042:16 map self-hosted:286:17 convertFromSessionStoreClosedData chrome://browser/content/parent/ext-browser.js:1041:21 getRecentlyClosed chrome://browser/content/parent/ext-sessions.js:25:15 getRecentlyClosed chrome://browser/content/parent/ext-sessions.js:91:18 InterpretGeneratorResume self-hosted:1255:8 next self-hosted:1210:9

background.js:33:5 `
M-Reimer commented 5 years ago

My guess would be that, if there is something interesting, then it fails earlier. Maybe directly after browser startup. Best would be to have a full log starting from "browser newly started" up to "click on the icon".

Homer-Sim commented 5 years ago

here we go: ` Bootstrapped manifest not allowed to use 'resource' directive. chrome.manifest:2 The webRequest.addListener filter doesn't overlap with host permissions. ext-webRequest.js:46 Unkown category for SetEventRecordingEnabled. unreachable code after return statement master.js:355:3 unreachable code after return statement wistia.js:268:3 listener not re-registered ExtensionCommon.jsm:2092 No such native application com.nimbus.ffmpeg NativeMessaging.jsm:99 entry is undefined ext-browser.js:833 Error: listener not re-registered ExtensionCommon.jsm:2092:24 Content Security Policy: 'x-frame-options' wird wegen 'frame-ancestors'-Direktive ignoriert. Gemischte (unsichere) Anzeige-Inhalte von "http://img.geocaching.com/stats/img.aspx?txt=aka+araber95&uid=33e71df6-b12f-4aec-a82a-d578f422120c" werden auf einer sicheren Seite geladen[Weitere Informationen] viewtopic.php TypeError: tabs is undefined background.js:96:3 Error: Missing host permission for the tab undefined Invalid chrome URI: / Error: Missing host permission for the tab undefined Gemischte (unsichere) Anzeige-Inhalte von "http://img.geocaching.com/stats/img.aspx?txt=aka+araber95&uid=33e71df6-b12f-4aec-a82a-d578f422120c" werden auf einer sicheren Seite geladen[Weitere Informationen] viewtopic.php XrayWrapper denied access to property "menus" (reason: property has accessor). See https://developer.mozilla.org/en-US/docs/Xray_vision for more information. Note that only the first denied property access from a given global object will be reported. ExtensionContent.jsm:907:6 Error: Promised response from onMessage listener went out of scope ExtensionMessagingService.js:89:9 XrayWrapper denied access to property "menus" (reason: property has accessor). See https://developer.mozilla.org/en-US/docs/Xray_vision for more information. Note that only the first denied property access from a given global object will be reported. ExtensionContent.jsm:907:6 Content Security Policy: Die Direktive 'child-src' sollte nicht mehr verwendet werden. Bitte verwenden Sie stattdessen die Direktive 'worker-src' zum Kontrollieren von Workern bzw. die Direktive 'frame-src' zum Kontrollieren von Frames. Content Security Policy: "'unsafe-inline'" wird innerhalb von script-src oder style-src ignoriert: nonce-source oder hash-source angegeben Content Security Policy: Die Einstellungen der Seite haben das Laden einer Ressource auf inline blockiert ("script-src"). 1 unreachable code after return statement wistia.js:268:3 unreachable code after return statement master.js:355:3 ReferenceError: browsertabs is not defined media.js:266:4 Error: Promised response from onMessage listener went out of scope ExtensionMessagingService.js:89:9 entry is undefined ext-browser.js:833 ReferenceError: browsertabs is not defined media.js:266:4 Error: Promised response from onMessage listener went out of scope ExtensionMessagingService.js:89:9 [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOMWindowUtils.addSheet]" nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: resource://gre/modules/ExtensionCommon.jsm :: runSafeSyncWithoutClone :: line 65" data: no] Tastenereignis ist in manchen Tastaturlayouts nicht verfügbar: Taste="i" Modifikatoren="accel,alt,shift" ID=“key_browserToolbox” browser.xul entry is undefined ext-browser.js:833

background.js:33:5 TypeError: tabs is undefined background.js:96:3 entry is undefined ext-browser.js:833 background.js:33:5 TypeError: tabs is undefined background.js:96:3 entry is undefined ext-browser.js:833 background.js:33:5 t_domcontent www.facebook.com:3:1207 perf_trace {"name": "e2e", "parent": "PageEvents.AJAXPIPE_ONLOAD"} rJO9fmYP-bT.js:10:3340 t_hooks www.facebook.com:3:1207 t_layout www.facebook.com:3:1207 t_onload www.facebook.com:3:1207 `
M-Reimer commented 5 years ago

Thanks. Seems like the root of the problem is the same as I already had here: https://github.com/M-Reimer/undoclosetab/issues/24#issuecomment-350187329 The first interesting line is: entry is undefined ext-browser.js:833 And it happens first shortly after browser start, which is the time where the context menu of my extension should be generated. Seems to be this line in the current Mozilla nightly (line somewhat shifted as they seem to have slimmed that file a bit): https://dxr.mozilla.org/mozilla-central/source/browser/components/extensions/parent/ext-browser.js#819 So clearly a Firefox internal bug. I just don't know, so far a) If I'm able to somehow workaround this and b) How to resurrect from this "buggy state".

M-Reimer commented 5 years ago

Try to locate this file in your profile: http://kb.mozillazine.org/Sessionstore.js Close all Firefox instances. Then rename it, so Firefox can't find it. Start Firefox.

M-Reimer commented 5 years ago

Reported upstream: https://bugzilla.mozilla.org/show_bug.cgi?id=1509701

M-Reimer commented 5 years ago

Can you please try deleting/renaming that file? Would be actually pretty interesting if this solves the issue.

Homer-Sim commented 5 years ago

I moved it to a differnt location and restarted ff without a positiv effect still not working, sorry

M-Reimer commented 5 years ago

Then the only thing, that could help to track this down, is if someone, who actually has the problem, backs up his profile and keeps deleting profile files until the problem goes away. It actually is pretty difficult to destroy a profile as nearly every file gets recreated with a "new" copy at the next Firefox startup.

I remember that, at least on Windows, there were two profile directories. One in "Roaming" app data and one in "local" or something like that. Have no Windows available, so I can't check. Maybe have a look at the "local" first, which is where Firefox keeps caches.

mmacek7 commented 5 years ago

Hi! Posting if it may help investigation.

I've noticed a problem like this with another extension (tab stash): entry is undefined ext-browser.js:811 convertFromSessionStoreClosedData chrome://browser/content/parent/ext-browser.js:811:7 convertFromSessionStoreClosedData/result.tabs< chrome://browser/content/parent/ext-browser.js:1020:16 map self-hosted:286:17 convertFromSessionStoreClosedData chrome://browser/content/parent/ext-browser.js:1019:21 getRecentlyClosed

chrome://browser/content/parent/ext-sessions.js:25:15 getRecentlyClosed chrome://browser/content/parent/ext-sessions.js:91:18 InterpretGeneratorResume self-hosted:1257:8 next self-hosted:1212:9

The problem was in this part of the code:

const getRecentlyClosed = (maxResults, extension) => { let recentlyClosed = [];

// Get closed windows let closedWindowData = SessionStore.getClosedWindowData(false); for (let window of closedWindowData) { recentlyClosed.push({ lastModified: window.closedAt, window: Window.convertFromSessionStoreClosedData(extension, window)}); } ...

After reopening of all recently closed windows, I no longer have this problem... (probably until I close the window again). Ffx 64.0

Ingvix commented 5 years ago

I also learned that an easiest workaround for me would be to use some addon to save your session and then start a new window and close the old one. Now the addon works again and I can restore the session without losing anything significant. I'm using Tab Session Manager for the session saving and restore.

M-Reimer commented 5 years ago

All affected people can have a look at this: https://github.com/M-Reimer/undoclosetab/issues/64#issuecomment-525032919 @532910 found the problematic file. Deleting sessionstore.jsonlz4 and sessionstore-backups from a "corrupted" profile may fix this issue.

M-Reimer commented 4 years ago

I've created some step-by-step instructions: https://github.com/M-Reimer/undoclosetab/wiki/How-to-fix-broken-browser-session

I've already linked this in my README.md and I'll link this on addons.mozilla.org, too.

This only happens if the browser is set to restore the previous session. So that's what I'll do on all my systems, now. I hope I'll run into this myself at some time. If I manage this, I could debug into the Firefox source code to find the root cause for this.

M-Reimer commented 4 years ago

I've added the link to the addons.mozilla.org page.

I've also configured all my Firefox installations to restore the previous session in hope I'll run into this bug at some time.

If someone here runs into the bug again and wants to share the sessionstore.jsonlz4 with me (may contain private information!), then comment here so we can get into contact. Having an already broken file may allow me to reproduce the issue and so debug this to create a patch for Firefox itself.

M-Reimer commented 4 years ago

There is a good chance that version 6.0.0 also fixes this one. Most probably the "opens random tabs or windows" problem is the same which can also cause the Add-on to no longer work at all.

Version 6.0.0 contains a workaround which keeps the list of recently closed tabs or windows empty between session restores. To compensate for that, the information is copied into a list inside the Add-on itself.

M-Reimer commented 3 years ago

I had several cases in the past where my instructions here https://github.com/M-Reimer/undoclosetab/wiki/How-to-fix-broken-browser-session helped users to revive a broken Sessions API. So the problem unfortunately is not gone. To keep this tracked I'll reopen this one. The bug that needs to be fixed by Mozilla is: https://bugzilla.mozilla.org/show_bug.cgi?id=1509701

Vicout commented 3 years ago

If someone here runs into the bug again and wants to share the sessionstore.jsonlz4 with me (may contain private information!), then comment here so we can get into contact. Having an already broken file may allow me to reproduce the issue and so debug this to create a patch for Firefox itself.

M-Reimer commented 3 years ago

At first backup that profile. Just in case more files are needed. And if the sessionstore is not too big you could just email to manuel.reimer@gmx.de

M-Reimer commented 3 years ago

If it is bigger, then tell me and I set up an upload form for you to directly upload to my private server.

kconover commented 1 year ago

I'm not sure if this is the same problem or not. I just set up Firefox on a new Windows 11 machine (instead of upgrading form Win10 to Win11, I just got a new PC graphics workstation with Win11 preinstalled). I installed the extension, and then, in Customize Toolbar, I can't see a button I can drag to the toolbar. I can't right-click the toolbar and get a context menu. I tried uninstalling and reinstalling, didn't help. I tried about:preferences option. The "fix browser session above" (NB: the option is now "Open Previous windows + tabs") didn't work. I saw a suggestion elsewhere to delete from the profile folder extension* and and compatibility.ini and let Firefox recreate, this didn't work either. Also interestingly, this occurred on my laptop which I upgraded from Win10 to Win11. (After learning the foibles of Win11 on my new desktop.) Any other suggestions that are not on the general order of "first, reformat your C: drive"? Thank you.

M-Reimer commented 1 year ago

Newer Firefox have a silly "Add-ons" button where you should find the Add-on and can pin it to the toolbar. Mozilla just never fails to disappoint 😔

kconover commented 1 year ago

OMG.

I have been a UX dweeb for decades, lectured internationally. Yes, information hiding is important, but it doesn't mean "hide important functions from users under a button with a misleading tooltip." I saw the button but figured that since the tooltip said "extensions" it just led to about:addons. We talk about "discoverability" and this button has zero discoverability. And you would think that the "customize toolbar" dialog box, which is where these buttons used to be, and the most likely place for a user to look for them, would have a link to it or at least a postit directing us to the right place. As Alan Cooper once famously said, "explanatory text in the user interface is a sign of a design failure, just like a postit on a monitor."

I love Firefox and continue to use it all the time, but at times like this I hate it. This is a good place to put an "upstream" tag purely on UX grounds. If I might venture a suggestion for a major user interaction design change for Firefox that will require a massive amount of coding to at least partially fix this problem?

Change the tooltip from "Extensions" to "Extension buttons." If you don't think changing a single word can make a big difference, check out:

http://ed-informatics.org/2012/02/04/whats-in-a-word/ and

http://ed-informatics.org/2009/12/28/medical-computing-2/

This still leaves the problem of people looking at the "customize toolbar" page for the extension buttons. This is left as an exercise for the reader. (Yes, I'm a university professor, it's legal for me to do this.)

Gitoffthelawn commented 1 year ago

@kconover I'm a UX expert too, and I'm convinced that Mozilla management has no idea that people with formal training in usability and human factors engineering actually exist. Mozilla management seems to just hire random people to "go for it" without the education, experience, and requisite skills to get the job done well. The results are, sadly, what we see in Firefox. And they are what we will continue to see until Mozilla opens their eyes.

Mozilla reminds me of a modern hospital that is unaware that doctors exist; thus Mozilla continues to hire alchemists hoping they will magically cure the ill.

kconover commented 1 year ago

Maybe we need a formal team of volunteer UX types to advise Mozilla? Purely out of self-interest?

M-Reimer commented 1 year ago

I partially agree and I've sent a suggestion to Mozilla to probably better integrate the new button with the common toolbar customize workflow. I'll keep you updated if something changes.

kconover commented 1 year ago

Thanks very much, Manuel!

--Keith

Keith Conover, M.D., FACEP, FASRC Clinical Associate Professor, Emergency Medicine, University of Pittsburgh School of Medicine

From: Manuel Reimer @.> Sent: Saturday, February 11, 2023 03:48 To: M-Reimer/undoclosetab @.> Cc: Conover, Keith @.>; Mention @.> Subject: Re: [M-Reimer/undoclosetab] Addon no longer works because of Firefox profile corruption (#38)

I partially agree and I've sent a suggestion to Mozilla to probably better integrate the new button with the common toolbar customize workflow. I'll keep you updated if something changes.

- Reply to this email directly, view it on GitHubhttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FM-Reimer%2Fundoclosetab%2Fissues%2F38%23issuecomment-1426664306&data=05%7C01%7Ckconover%40pitt.edu%7Caa65bd1082ed45d4365d08db0c0cbed7%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C638117021119570170%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=EBKbqVJf8K7fkai2ENQeY8O6nZL%2F4AVCDevhz%2Bc3EG4%3D&reserved=0, or unsubscribehttps://nam12.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FACWZR2CS4Z5ZQB6TGDL5NELWW5G5ZANCNFSM4GGGFJSQ&data=05%7C01%7Ckconover%40pitt.edu%7Caa65bd1082ed45d4365d08db0c0cbed7%7C9ef9f489e0a04eeb87cc3a526112fd0d%7C1%7C0%7C638117021119570170%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jVfML32r130zrT3dzCLxaZspNB%2FXKBQr62AUMSWqUtE%3D&reserved=0. You are receiving this because you were mentioned.Message ID: @.***>