[Ext] Cookie Controller, now with DOM storage

Announce and Discuss the Latest Theme and Extension Releases.
Locked
Diamanti
Posts: 778
Joined: June 12th, 2008, 9:02 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by Diamanti »

I found a fix:
replace:

Code: Select all

    onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags)
    {
        // Reset the buttons if the top level document changes      
        if (aWebProgress.DOMWindow != content || aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) return;
        this.setPermButton();
        setTimeout(this.tidyNotification, 250);
    },


with:

Code: Select all

    onLocationChange: function(aWebProgress, aRequest, aLocation, aFlags)
    {
        // Reset the buttons if the top level document changes      
      if(aFlags===1) aFlags=0;//SM Fix by Alx
        if (aWebProgress.DOMWindow != content || aFlags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) return;
        this.setPermButton();
        setTimeout(this.tidyNotification, 250);
    },


I do not know why but FF return to aFlag = 0 while SM returns a aFlag = 1
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by lithopsian »

https://bugzilla.mozilla.org/show_bug.cgi?id=1035171

Looks like it will be fixed very soon. Thanks for the research.

I'll just update the NULL->null things. I'm not going to change the flag check, it is there for a reason.
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by lithopsian »

Now showing as fixed from SeaMonkey 2.29.1 onwards. Timing is everything :)
Diamanti
Posts: 778
Joined: June 12th, 2008, 9:02 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by Diamanti »

ok ty. I did not think SM would be so timely.
Diamanti
Posts: 778
Joined: June 12th, 2008, 9:02 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by Diamanti »

Do it is possible to add this code for a better SeaMonkey support:

Code: Select all

            // Open a new dialog
         if(Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULAppInfo).name==="SeaMonkey"){//Alx
            var chrome = {"Browser:Permissions":       "chrome://communicator/content/permissions/permissionsManager.xul",
               "Browser:AboutPermissions": "about:data",
               "Browser:Cookies": "about:data",
               "Preferences:ConfigManager": "chrome://global/content/config.xul"}[type];
         }else{
            var chrome = {"Browser:Permissions":       "chrome://browser/content/preferences/permissions.xul",
               "Browser:AboutPermissions":  "chrome://browser/content/preferences/aboutPermissions.xul",
               "Browser:Cookies":           "chrome://browser/content/preferences/cookies.xul",
               "Preferences:ConfigManager": "chrome://global/content/config.xul"}[type];
         }
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by lithopsian »

This sort of thing is the reason why I dropped SeaMonkey support ;) I'm not keen on this change. There is more code attached to these dialogs, which in Firefox does things like initialising and filtering within the dialog. That won't work right in SeaMonkey, so there would need to be more changes to not execute that code or to make sure it doesn't break anything, and then I'll end up trying to support a program that I don't use.
Drew_vt
Posts: 3
Joined: September 10th, 2012, 9:06 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by Drew_vt »

Hi,

I like this add-on very much, more than any other cookie extension I've used; the controls are extensive without being overly complicated.

But there is one aspect which is still not very clear to me: when configured to delete a specific site's cookies, does this add-on also take care of deleting flash cookies and such, or is it still necessary to install an additional add-on (such as BetterPrivacy) for that purpose? (I am guessing that this is what is meant with "DOM storage", but as I said, it's not very clear to me). Thank you very much.
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Re: [Ext] Cookie Controller, now with DOM storage

Post by alta88 »

Why does toggling cookies on immediately set a Google cookie? The showing site is not anything related to google, and it's claimed only 1st party cookies are enabled.
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by lithopsian »

Drew, Cookie Controller does nothing with Flash cookies. It doesn't block them (or allow them) and it doesn't ever delete them.

DOM Storage is different. It is a feature native to Firefox that allows web sites (and possibly addons, but that would be fairly pointless) to store considerable amounts of data (up to 5MB per web site by default, but configurable) either just for this session (Session Storage) or permanently (Local Storage). Cookie Controller does control DOM Storage. Firefox applies the cookie permissions to DOM Storage.
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by lithopsian »

alta88 wrote:Why does toggling cookies on immediately set a Google cookie? The showing site is not anything related to google, and it's claimed only 1st party cookies are enabled.

Well the simple answer is it doesn't :) You may have a different configuration to me, more likely an addon that is waiting for cookie permissions to change so it can set a cookie. Or perhaps the cookie was there all along, but it now becomes visible to a web page?
alta88
Posts: 1029
Joined: January 28th, 2006, 3:08 pm

Re: [Ext] Cookie Controller, now with DOM storage

Post by alta88 »

Hmm. You're right, it seems removing that cookie in the cookies dialog did not remove it from cookies.sqlite as inspected by SQLiteManager, although it disappeared from the list. So reopening the dialog showed it there again. It had an appId of -2, may need to look into it. Removing all cookies in the dialog did get rid of it.
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by lithopsian »

Cookie Controller 3.7 does not work properly in multi-process enabled versions of Firefox. If you don't know what this means then you probably don't need to worry about it for now.

In version 3.8 just released I have disabled tracking of DOM storage items when in e10s mode, so that the rest of the addon will work. All permission functions should work correctly, but the number of session storage and local storage items for a page will not be shown. You also won't be able to delete DOM storage items. It should still work normally in Firefox release versions and Firefox nightly with e10s disabled. I will add these functions back when it becomes clear just what interfaces in Firefox are going to be supported under e10s.
Grat2
Posts: 9
Joined: February 12th, 2015, 2:57 pm

Re: [Ext] Cookie Controller, now with DOM storage

Post by Grat2 »

Hopefully it will be solved once e10s reaches the release channel :)

Thanks for Cookie Controller. I love it. I noticed recently that IndexedDB can be used for storage without prompting the user. Considering IndexedDB cannot be deleted by clearing history, would it be possible to update Cookie Controller so that it covers IndexedDB like it (normally) does DOM Storage ?


Be careful though, dom.indexedDB.enabled cannot be set to false until Firefox 37. Before Firefox 37, if it is set to false then some extensions such as Adblock Plus and some Firefox internals might break. Starting with Fx 37, this pref only applies to content so it can be safely disabled.

AsmJS also caches compiled code per origin using IndexedDB. I guess such caching should be allowed even when cookies are disabled. The problem is that it is not deleted when we clear history; maybe Cookie Controller can clear it with the cookies and DOM storage ? (e.g. Unity3D HTML5 demo)


Thanks either way!
lithopsian
Posts: 3664
Joined: September 15th, 2010, 9:03 am

Re: [Ext] Cookie Controller, now with DOM storage

Post by lithopsian »

Yes, I'll get e10s sorted before it hits the release version, but that is still many many months away.

I agree it would be nice to have better control and visibility over indexedDB. After all, it allows almost anyone to store a massive amount of data on your computer, and it doesn't even ask any more (the ask-first pref is now default off). The problem is that it uses an entirely separate permissions system to cookies and DOM storage. That effectively means a different addon (maybe there is one already?) or at least another button. The whingers out there will complain about how complicated it all is, despite the fact nobody is holding a gun to their heads to install every (or any!) available button.

Clearing indexedDB is fairly straightforward for an addon, but also risky since addons that use it could be impact. Same for web apps really, since they are effectively web-based addons and the user has to explicitly "install" them. I'll have to think about how to address it, maybe add some simple toggles and quick access to the relevant Firefox dialogs before trying for a full-blown "indexedDB Controller". This is a bit down the to-do list at the moment though, what with all the e10s changes that manage to impact my addons even though they never touch actual content.
Locked