2008-10-26

Fantasia

Play

Chrome_Incognito.js

If you haven't updated to 0.3.154.9 this script may still be of use. But, with that version you can now append: ...chrome.exe" --incognito to your Google Chrome shortcut and it will start in Incognito mode by default.

Save snippet below to a file (call it something like Chrome_Incognito.js) in 'My Documents' folder or the desktop. Double-click this file, & it opens a chrome browser window, then, an incognito window, then, shuts first window...leaving you "incognito".

If you have trouble saving code snippits see notes here.


//Chrome_Incognito.js - start chrome incognito
var oSh=new ActiveXObject("WScript.Shell");
var liWait=1500;  //wait ms (double on older pc)
var Chrome_HKLM="HKLM\\"+
  "SOFTWARE\\"+
  "Classes\\"+
  "ChromeHTML\\"+
  "shell\\"+
  "open\\"+
  "command\\";
var Chrome=oSh.RegRead(Chrome_HKLM);
oSh.Run(Chrome); //start chrome
WScript.Sleep(liWait);
oSh.Sendkeys("^+N"); //start new incognito window
WScript.Sleep(liWait);
oSh.Sendkeys("%{Tab}"); //go previous(first) browser window
WScript.Sleep(liWait);
oSh.Sendkeys("%{F4}"); //close first browser window


...here it is in .vbs (VBScript):
'Chrome_Incognito.vbs - start chrome incognito
Set oSh=CreateObject("WScript.Shell")
Dim Chrome_HKLM
Chrome_HKLM="HKLM\" & _
  "SOFTWARE\" & _
  "Classes\" & _
  "ChromeHTML\" & _
  "shell\" & _
  "open\" & _
  "command\"
Dim Chrome
Chrome=oSh.RegRead(Chrome_HKLM)
oSh.Run Chrome
ccSleep 1
oSh.Sendkeys "^+N"
ccSleep 1
oSh.Sendkeys "%{Tab}"
ccSleep 1
oSh.Sendkeys "%{F4}"
WScript.Quit
'-
Sub ccSleep(seconds)
  set oShell = CreateObject("Wscript.Shell")
  cmd = "%COMSPEC% /c ping -n " & 1 + seconds & " 127.0.0.1>nul"
  oShell.Run cmd,0,1
End Sub
'-this ccSleep I got from : http://www.mvps.org/scripting/rube/index.htm
Notes:

The saved file icon should display as fancy-scroll "S". If not -- the editor may be "helping" by automatically adding(& hiding) the ".txt" extention. To get around save in double-quotes: "Chrome_Incognito.js" -- and the name with this extention should "stick".

If double-clicking the file opens it in the editor -- script "open" is interpreting as "open with editor" -- to get around: ctrl+shift+click to obtain a context menu that will have an "Open with..." option. Choose this - then choose: "Microsoft (R) Windows Based Script" (and check "always use..." -- if you prefer it).

In these scripts I'd originally specified Run("Chrome.exe") - didn't always work. I tried adding instructions to check properties/copy settings from Google Chrome launch short-cut, but, again, found this didn't work for some users.

These scripts read system registry to determine Chrome location, and, hopefully, remove implementation differences and need for manual edit.

P.s. I've seen notes on the internet of starting chrome with '--incognito' startup parm -- but, that doesn't appear to work (at least with Google Chrome version 0.2.149.30 - does starting with 0.3.154.9).

P.s.s. If brave - try putting the snippet below at bottom of the first .js script from above.

This combines "Incognito" and using Google servers as a proxy to hide IP address. Having IP address logged I find an annoyance. Some software programs assume things and take unwanted actions based on returning IP address.

P.s.s.s.  These scripts and techniques work for me. If you have concerns about other "research" going on - the PC can be placed in in a public area to encourage safe (vs. anonymous) browsing habits.
var sURL=
"http://translate.google.com/"+
"translate"+
"?ie=UTF-8"+
"&sl=es"+
"&tl=en"+
"&hl=en"+
"&u="+
"http://www.anonymouse.org";
WScript.Sleep(liWait);
oSh.Sendkeys("{F6}");//go addressbar
WScript.Sleep(liWait);
oSh.SendKeys(sURL+"{Enter}");//supply "google proxy"
WScript.Sleep(liWait);

Some have asked if there's a way to check if Chrome is already running. To do so --is more complicated see version #2

-Thanks/regards

LibriVox's New Releases

Blog Archive

Powered By Blogger