Exporting only last changes

Ask for help about NoScript, no registration needed to post
barbaz
Senior Member
Posts: 11141
Joined: Sat Aug 03, 2013 5:45 pm

Exporting only last changes

Post by barbaz »

As you may know, I always run my browser in a sandbox that gets almost completely dumped on exit. So far, this has worked great - save downloads, copy+paste other noteworthy stuff, scrap the rest as unneeded.

Worked great...until now. Now, I'm making too many changes with bookmarks and NoScript permissions to keep up.

So how to export only the changes? How to save only the changes to the NoScript whitelist/Untrusted list, and only specific bookmarks, to be later imported outside that sandbox?

Thanks for any suggestions.
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Exporting only last changes

Post by Thrawn »

I don't know where bookmarks are stored, offhand...but you could probably use diff+grep to grab the preference changes and save them to another file.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
barbaz
Senior Member
Posts: 11141
Joined: Sat Aug 03, 2013 5:45 pm

Re: Exporting only last changes

Post by barbaz »

Thrawn wrote:I don't know where bookmarks are stored, offhand..
places.sqlite - which, unfortunately for this, contains much more than just bookmarks.
Thrawn wrote: you could probably use diff+grep to grab the preference changes and save them to another file.
Thanks Thrawn, it sounds like a good approach, but I'm missing something here.

1) Clean sandbox, do full NoScript config export and NoScript whitelist export
2) In the sandbox containing desired changes, do full NoScript config export and NoScript whitelist export
3) Use diff (or meld) to vet changes
4) Once satisfied, use diff and grep to create a "merged" NoScript config...how?
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Exporting only last changes

Post by Thrawn »

Well, I was actually thinking to use diff+grep to extract the changes (diff original prefs file with sandbox, pipe through grep to isolate just the desired prefs).

You might be able to automate the merge using the 'patch' tool...I haven't played around with it much. Since you have Meld, that could work too, just compare the entire files.
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
barbaz
Senior Member
Posts: 11141
Joined: Sat Aug 03, 2013 5:45 pm

Re: Exporting only last changes

Post by barbaz »

Thrawn wrote:Since you have Meld, that could work too, just compare the entire files.
Image Silly me, indeed meld does work.

I mentioned meld just because it highlights differences within lines, something very helpful when working with long lines. Never realised how easy it is to actually merge changes using meld.

Couple notes about meld:
1) Edit > Preferences, check "Enable text wrapping" and un-check "Do not split words over two lines". This gets rid of the horizontal scrolling, thus making it easier to spot the changes.
2) The arrows and such pointing between the compared files, are actually clickable. They indicate what action they will take if clicked.

So it's really pretty slick to take out changes to prefs that are rather left alone.

Great, that takes care of that part. Image
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
therube
Ambassador
Posts: 7979
Joined: Thu Mar 19, 2009 4:17 pm
Location: Maryland USA

Re: Exporting only last changes

Post by therube »

Bookmarks can be exported to html or json.
Html can be done manually & or automated on browser close.
Json, manually. Not sure about automated?

Some items may trip you up more then wanted, LAST_MODIFIED or "favorite icons", kind of thing.

Maybe there's an extension to export only selected data, like "name", URL ...?
Or there's always sqlite.
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.19) Gecko/20110420 SeaMonkey/2.0.14 Pinball NoScript FlashGot AdblockPlus
Mozilla/5.0 (Windows NT 5.1; rv:43.0) Gecko/20100101 SeaMonkey/2.40
barbaz
Senior Member
Posts: 11141
Joined: Sat Aug 03, 2013 5:45 pm

Re: Exporting only last changes

Post by barbaz »

JSON bookmark backups lose some data, such as favicons, so that won't work.

The HTML bookmark backup would work if there is a way to only export selected bookmarks. Otherwise everything, including folders, gets duplicated at import. Unlike the NoScript config, this isn't just a matter of comparing diffs and merging.
*Always* check the changelogs BEFORE updating that important software!
-
User avatar
Thrawn
Master Bug Buster
Posts: 3106
Joined: Mon Jan 16, 2012 3:46 am
Location: Australia
Contact:

Re: Exporting only last changes

Post by Thrawn »

barbaz wrote:indeed meld does work.
I use it regularly. I included support for it in my Lua scripts for Geany, and I made myself a shell alias 'svmeld' for 'svn diff --diff-cmd=meld' (although Git is taking over now).
======
Thrawn
------------
Religion is not the opium of the masses. Daily life is the opium of the masses.

True religion, which dares to acknowledge death and challenge the way we live, is an attempt to wake up.
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
barbaz
Senior Member
Posts: 11141
Joined: Sat Aug 03, 2013 5:45 pm

Re: Exporting only last changes

Post by barbaz »

Since the NoScript side of this is solved I might head to mozillaZine about the bookmarks. Thanks again for your help.

EDIT http://forums.mozillazine.org/viewtopic ... &t=3024478
*Always* check the changelogs BEFORE updating that important software!
-
Post Reply