kee-org / KeeFox

Legacy browser and XUL application integration with KeePass Password Safe. See https://github.com/kee-org/browser-addon for the new version for Firefox 57+
https://forum.kee.pm
418 stars 48 forks source link

Showing install/upgrade page makes session restore behave weird #166

Closed elieux closed 10 years ago

elieux commented 11 years ago

I suspect this is caused by something in my Firefox profile, but it happened enough times I want to mention it and ask for help.

Sometimes (maybe only after Firefox crash/termination) when KeeFox wants to show me the upgrade page (because it's detected KeePassRPC is different version than the one bundled with the add-on), it causes all other tabs to lose their favicons and when I click on any of them, they pretend to load for a second and then stay blank and the address bar is blank, too.

I have "Don't load tabs until selected" enabled and various add-ons installed. I suspect the issue is somewhere among that setting and "Load Tabs Progressively", "Location Bar Enhancer", "Omnibar" add-ons and of course KeeFox.

I'm OK with no-one except myself working on this, but will appreciate any help provided.

List of my add-ons formatted as "[name] [version] [enabled] [id]":

Aaapptabs   1.0 true    jid0-4lCWKLkuXBNbApFwqYAr8GZdNAs@jetpack    
Acebug  1.11.0  true    acebug@mozilla.org  
Add to Search Bar   2.0 true    add-to-searchbox@maltekraus.de  
BetterPrivacy   1.68    true    {d40f5e7b-d2cf-4856-b441-cc613eeffbe3}  
Cert Viewer Plus    1.9 true    {cafefdef-5ef8-4222-a8dd-bfd298784eca}  
Certificate Patrol  2.0.14  true    CertPatrol@PSYC.EU  
Cleanest Addon Manager  7.0 true    cam@sdrocking.com   
Controle de Scripts 1.0.3   true    {75e19832-90c0-4553-91a0-e5d0ac5d99fd}  
DNSSEC Validator    2.0-beta1   true    dnssec@nic.cz   
Downloads in Tab    1.00    true    downintab@max.max   
easy Xdebug (with moveable icon)    0.6.2   true    jid0-BorozO8WGKHFMLkJSg7FSAJtr8o@jetpack    
EventBug    0.1b10  true    eventbug@getfirebug.com 
Fasterfox   3.9.81  true    {c36177c0-224a-11da-8cd6-0800200c9a91}  
FindBar Tweak   0.5.5   true    fbt@quicksaver  
Firebug 1.11.2  true    firebug@software.joehewitt.com  
FireGestures    1.6.21  true    firegestures@xuldev.org 
FirePath    0.9.7   true    FireXPath@pierre.tholence.com   
FirePHP 0.7.1   true    FirePHPExtension-Build@firephp.org  
FireQuery   1.3 true    firequery@binaryage.com 
FireRainbow 1.5 true    firerainbow@hildebrand.cz   
FlashFirebug    4.67    true    flashfirebug@o-minds.com    
FlashGot    1.5.5   true    {19503e42-ca3c-4c27-b1e2-9cdb2170ee34}  
Greasemonkey    1.8 true    {e4a8a97b-f2ed-450b-b12d-ee082ba24781}  
Growl/GNTP  1.2.5   true    growlgntp@brian.dunnington  
HeaderControlRevived    1.1 true    headercontrolrevived@torvin 
Html Validator  0.9.5.1 true    {3b56bcc7-54e5-44a2-9b44-66c3ef58c13e}  
HTTPS Finder    0.85    true    {6bdc61ae-7b80-44a3-9476-e1d121ec2238}  
HTTPS-Everywhere    3.1.4   true    https-everywhere@eff.org    
It's All Text!  1.6.4   true    itsalltext@docwhat.gerf.org 
JS Deminifier   1.0.8   true    jsdeminifier@murphy.ben.name    
JSONovich   1.9.6.1 true    jsonovich@lackoftalent.org  
keyconfig   20110522    true    keyconfig@dorando   
Link And Forminfo   2.0 true    {B71ACFF2-E436-4cc7-B5E3-0C8E2CC981BA}  
LinkSidebar 1.0.3   true    linksidebar@extendtech.extensions.com   
Load Tabs Progressively 1.6.1   true    loadTabsProgressively@ithinc.cn 
Location Bar Enhancer   5.1 true    UIEnhancer@girishsharma 
MathML-fonts    1.1 true    MathML-fonts@mozilla.com    
Menu Editor 1.2.7   true    {EDA7B1D7-F793-4e03-B074-E6F303317FB0}  
Mozilla Archive Format  2.0.9   true    {7f57cf46-4467-4c2d-adfa-0cba7c507e54}  
Mozilla Labs: Prospector - Find Suggest 5   true    find.suggest@prospector.labs.mozilla    
NoRedirect  1.3.2.13    true    {c1970c0d-dbe6-4d91-804f-c9c0de643a57}  
NoScript    2.6.5.8 true    {73a6fe31-595d-460b-a920-fcc0f8843232}  
Omnibar 0.7.17.20130121 true    omnibar@ajitk.com   
Perspectives    4.3.3   true    perspectives@cmu.edu    
Pocket  3.0.1   true    isreaditlater@ideashower.com    
Preserve Download Modification Timestamp    2011.03.21.22   true    pdmts@caligonstudios.com    
RequestPolicy   0.5.27  true    requestpolicy@requestpolicy.com 
RSS Icon In Awesombar   1.4 true    rssicon@jasnapaka.com   
SiteDelta   0.13.2  true    sitedelta@schierla.de   
Stylish 1.3.1   true    {46551EC9-40F0-4e47-8E18-8E5CF550CFB8}  
TabSubmit   1.0.2.4 true    {421e87b4-d3d2-49c8-b08f-b83f4dc88444}  
Test Pilot  1.2.2   true    testpilot@labs.mozilla.com  
UploadProgress  0.9 true    fvicente@gmail.com  
Y U no validate 2012032501  true    {20d36f97-15da-47ed-9f0a-13cbe85bdc84}  
CodeBurner for Firebug  1.6 false   firebug@tools.sitepoint.com 
Console²   0.9 false   {1280606b-2510-4fe0-97ef-9b5a22eafe80}  
Context Search RG   1.1 false   contextsearchRG@mozilla.org 
Convergence 0.09    false   convergence@extension.thoughtcrime.org  
DownThemAll!    2.0.15  false   {DDC359D1-844A-42a7-9AA1-88A850A938A8}  
FoxyProxy Standard  4.1.3   false   foxyproxy@eric.h.jung   
InlineDisposition   1.0.2.4 false   {123647d5-da43-4344-bfe2-fc093bdf8f5e}  
KeeFox  1.2.2b1 false   keefox@chris.tomlinson  
Mouseless Browsing  0.5.3.1Build201101051500    false   {c0bcf963-624b-47fe-aa78-8cc02434cf32}  
Omnibar Plus    1.0.4   false   omnibarplus@quicksaver  
Operator    0.9.5.6 false   {95C9A302-8557-4052-91B7-2BB6BA33C885}  
PassIFox    1.1.5   false   passifox@hanhuy.com 
Redirector  2.8.1   false   redirector@einaregilsson.com    
SSL Blacklist   4.0.32  false   sslblacklist@codefromthe70s.org 
Tab Utilities Lite  1.5 false   tabutilslite@ithinc.cn  
Tahoe Data Manager  1.6 false   dataman@kairo.at    
YSlow   3.1.4   false   yslow@yahoo-inc.com 
luckyrat commented 11 years ago

I've seen this occasionally when using TabMixPlus but the fact you don't have that installed indicates that it might be a timing issue rather than something specific to TMP. Maybe TMP takes a long time to start or in some way alters the normal startup behaviour of Firefox such it breaks other addons like KeeFox which rely on an accurate indication of when a window is loaded and ready to be initialised with the KeeFox toolbar and other code.

It could be that multiple addons are able to trigger this behaviour but without more investigation I can't say whether it's likely to be a problem triggered by a certain behaviour in other addons or an issue that just happens to be more likely to occur with certain addons due to the length of time that they take to startup (or even the order in which Firefox starts all the addons).

To diagnose this further, we'll need to look at the keefox_win.mainEventHandler defined in keefox.js - maybe the currentWindow var passed to handleEvent() or the _assignedWindow property is not being set correctly in some circumstances?

Also worth noting that this file (and most others) currently run in strict mode but since it's very difficult to reliably test and debug issues that arise from enabling this mode, I'm intending to disable it for most or all files for the next (last?) 1.2.x beta (with the intention of re-enabling it for the 1.3 beta testing period and hopefully keeping it enabled for the 1.3 or 1.4 stable release). So maybe we could try changing this line in keefox.js:

"use strict";

to

"use non-strict";

Technically we could just remove the line but this makes it easier to track which files we want to enable or disable strict mode in and allows for a quick find and replace across all files when mass enabling or disabling the strict mode feature.

I'll not have time to look into this for at least a few days so if you want to take a look feel free and please let me know if you discover anything.

luckyrat commented 11 years ago

Oh yeah, one other thing that occurred to me is that the problems may have started around the same time as I started using pinned tabs.

I don't know anything about how they are implemented but the fact that they seem to be "always loaded" rather than "lazy loaded" suggests this might have something to do with it.

luckyrat commented 11 years ago

I've been unable to fix this and unable to verify whether the problem occurs in older versions of KeeFox (because I'm unable to reliably reproduce the problem in a dev environment).

Unfortunately, it looks like we'll just have to hope that it doesn't occur too frequently when KeeFox 1.2 is released.

What I've discovered so far:

Since you don't use TMP, there must be something else that can cause the same problem. If you could narrow down the problem to a single add-on, we might be able to home in on whatever part of TMP and the other addon are triggering this problem.

elieux commented 11 years ago

I appreciate your effort. I will try to find out which add-on(s) is causing this, but I can't give you any date as don't have much free time nowadays.

elieux commented 11 years ago

Just for reference, this is what happened today, when I updated KeePassRPC before updating KeeFox: firefox-with-keefox-updatepage-fail

I exited Firefox cleanly, updated KeePassRPC (because Thunderbird -- having newer KeeFox version -- complained) and started Firefox. When Firefox was starting, it showed only 2 tabs (I think), with one of them being the upgrade page. Then the rest of the tabs loaded and the upgrade page stayed on the second tab (instead of Facebook, that was there originally) and the last (rightmost) tab activated/opened itself. I could see the add-ons load progressively on the right side of the address bar (not shown in the picture), where I keep add-on buttons.

On first start-up, Firefox had been unresponsive for a while, so I killed it. On second try, it loaded completely and I could go to Add-ons to upgrade KeeFox.

For comparison, this is how the title+tab bar looks normally: firefox-after-keefox-update

luckyrat commented 10 years ago

I don't recall seeing this behaviour with the upgrade to 1.2.7 or 1.3.0b1. Here's hoping there was just some sort of Firefox bug that's been fixed now!

If we get all users upgraded to v 1.3 without seeing this again, I'll close the issue.

elieux commented 10 years ago

Today's upgrade went fine.

luckyrat commented 10 years ago

I've not seen a problem like this for ages so I'm putting it down to a now-resolved 3rd party bug, possibly Firefox.