Page 1 of 1
Exporting only last changes
Posted: Wed Oct 12, 2016 12:37 am
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.
Re: Exporting only last changes
Posted: Wed Oct 12, 2016 11:32 pm
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.
Re: Exporting only last changes
Posted: Thu Oct 13, 2016 2:03 am
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?
Re: Exporting only last changes
Posted: Thu Oct 13, 2016 3:04 am
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.
Re: Exporting only last changes
Posted: Thu Oct 13, 2016 5:57 am
by barbaz
Thrawn wrote:Since you have Meld, that could work too, just compare the entire files.

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.

Re: Exporting only last changes
Posted: Thu Oct 13, 2016 8:57 pm
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.
Re: Exporting only last changes
Posted: Thu Oct 13, 2016 9:19 pm
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.
Re: Exporting only last changes
Posted: Thu Oct 13, 2016 11:35 pm
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).
Re: Exporting only last changes
Posted: Fri Oct 14, 2016 2:23 am
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