privacy button: profile rewind via fileswap (obviously)
Saturday, 12. July 2008, 23:03:24
One of many cases where people are flummoxed by needs which require simple rename-and-swap file operations - and treat it as bizarre and unthinkable to set up utilities that actually perform them. This particular "extension" amounts to two tiny Xcopy utilities: one takes a pre-session snapshot of your Opera folder; the other puts it back and deletes the folder which has in the interim been polluted with what you'd rather exclude.
Nothing clever about it - it's just the required operation. But remarking that this is so causes the normal user to blink like a mindless penguin for a moment and then wander away, if I may be allowed such a remark. Don't suppose that will change; anyhow, here it is.
(As usual: file-op batch files contain paths and filenames specific to versions and installations of Opera, and commands which may change slightly between versions of Windows. The ones here work on my system; some tweaks may be needed. You should of course back up your installation before experimenting.)
2009-11-16: updated for Opera 10 & Windows XP but not yet tested. Advise waiting.
from this thread: IE8 offers "Porn Mode", What's Opera's version?. Actually good for more than porn: gives you the power to decide what's history worth having and what's just clutter.
The functions are
- Snapshot: copies current Opera folder as a folder named Snapshot
- Rewind: renames current Opera folder as Discard_Opera, renames Snapshot as Opera - prompts if you'd like to delete Discard_Opera; you can say No if there's anything you'd like to retain from it, then delete it manually.
The Rewind button can't be located within Opera: Opera will run the macro, Exit & execute program, 'RewindOpera.bat' - but files (such as browse history in Global_history.dat) are actually updated (from memory to disk as part of Opera shutdown) after the batch has run, which defeats it. So you need to put a shortcut to it outside of Opera (on desktop, Start menu, or Quicklaunch), close Opera first, then run it. Snapshot, however, can be invoked within Opera (as always, by any of menu, keystroke, gesture, or button). The command is, Execute program, "c:\utility\OperaSnapshot.bat". Here it is as a button: Snapshot
You need to make a c:\utility folder, and copy the two batch programs into it. Also need to correct the path in the second line (the CD command) to whatever the parent of your Opera folder is. For detailed instructions in a similar case, see my DOS backup blog post.
OperaSnapshot.bat
@prompt $G @cd "c:\windows\application data\Opera\opera" @if not exist snapshot\global_history.dat goto snapshot @set /p X=snapshot already exists; replace? 1:yes 2:no : @if not '%X%'=='1' goto no_op :snapshot @xcopy .\ snapshot\ /e /y @echo Snapshot taken. @exit :no_op @echo No operation. (Alt+F4 closes window)This will copy several hundred files, mostly cache and favicons, but it runs in a few seconds. I got an error that it couldn't copy something due to an overlong name - which turned out to be an icon to which Opera had given a very long escaped href as a name - so you may need to delete or rename a few of those.
RewindOpera.bat
@prompt $G @cd "c:\windows\application data\Opera\opera" @if not exist snapshot\global_history.dat goto none @rename profile Discard_profile @rename snapshot profile @if errorlevel 1 exit @echo Snapshot restored as current profile. @deltree Discard_profile @exit :none @echo There is no snapshot to restore; no operation performed.Details: both test for existence of Snapshot using global_history.dat, because the Exist test requires a filename. In the restore batch, I've let the prompt for Deltree - "delete the folder?" - come through - you need to answer y or n, then press Enter. You can eliminate this prompt by adding /y at the end of the Deltree line.
Or you can blink helplessly, using a system entirely made of files but thinking that file ops are too weird to consider, and go back to waiting for the devs to make everything better.






