AutoHotkey Community

It is currently May 26th, 2012, 8:13 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: June 18th, 2008, 7:53 am 
Offline

Joined: May 29th, 2008, 11:33 am
Posts: 24
Hi,
I'd like to be able to start the default browser with a blank screen (actually, the default welcome page for that browser is also fine).
I've tried:

Code:
Run http://about:blank


Code:
Run about:blank


Code:
Run %defaultbrowsercommand%


Nothing worked...

Is there a "natural" way to do that? (I don't want to create a file thats an empty html web page, for example)
I prefer something thats more like the third option. Is there an alias for the default browser?

Thanks!


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2008, 8:25 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8776
To find the default browser, you have to retrieve the key from registry, which is different in Vista and the previous windows versions.

To start a new blank instance of IE: Run iexplore.exe -new -nohome
Again, you will have to find the CLI swtiches for all other major browsers.

I suggest it would be better to load a local HTML file which could reset the address bar with null ( javascript ? )

:)

_________________
URLGet - Internet Explorer based Downloader
StartEx - Portable Shortcut Link


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 18th, 2008, 11:34 pm 
Offline
User avatar

Joined: December 21st, 2007, 3:14 pm
Posts: 3826
Location: Louisville KY USA
run http://google.com

_________________
No matter what your oppinion Please join this discussion
Formal request to Polyethene
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 1:15 am 
Perhaps if you use something like TinyURL to redirect to about:blank, it might work


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 5:25 am 
Offline

Joined: March 19th, 2007, 12:43 am
Posts: 532
here is a script for finding out a default browser http://www.autohotkey.com/forum/viewtop ... lt+browser

i tested this in FF:
Code:
#NoEnv
#SingleInstance Force
;;;;;#Persistent


;-----------------
;-- Document type
;-----------------
outputdebug
    ,Searching for the following registry key: HKEY_CLASSES_ROOT\.htm\

RegRead
    ,$DocumentType
    ,HKEY_CLASSES_ROOT
    ,.htm\

if not ErrorLevel
    outputdebug -- Found the following value: %$DocumentType%
 else
    {
    msgbox,
       (ltrim
        Routine halted.  Error reading the following registry key:
        HKEY_CLASSES_ROOT\.htm\
       )
    return
    }


;-------------------------
;-- Default shell command
;--   for document type
;-------------------------
outputdebug,
   (ltrim join
    Searching for the following registry key:%A_Space%
    HKEY_CLASSES_ROOT\
    %$DocumentType%\
    shell\
   )

RegRead
    ,$DefaultShellCommand
    ,HKEY_CLASSES_ROOT
    ,%$DocumentType%\shell\

if not ErrorLevel
    outputdebug -- Found the following value: %$DefaultShellCommand%
 else
    {
    outputdebug -- NOT found.  Setting to "open"
    $DefaultShellCommand=open
    }


;-----------------------
;-- Default web browser
;-----------------------
outputdebug,
   (ltrim join
    Searching for the following registry key:%A_Space%
    HKEY_CLASSES_ROOT\
    %$DocumentType%\
    shell\
    %$DefaultShellCommand%\
    command
   )

RegRead
    ,$WebBrowserCommand
    ,HKEY_CLASSES_ROOT
    ,%$DocumentType%\shell\%$DefaultShellCommand%\command

if not ErrorLevel
    outputdebug -- Found the following value: %$WebBrowserCommand%
 else
    {
    msgbox,
       (ltrim join
        Routine halted.  Error reading the following registry key:%A_Space%
        HKEY_CLASSES_ROOT\
        %$DocumentType%\
        shell\
        %$DefaultShellCommand%\
        command
       )
    return
    }


;-----------------------
;-- Extract information
;-----------------------
outputdebug Before cleanup - $WebBrowserCommand=%$WebBrowserCommand%

;-- Remove double-quotes around the program path (if they exist)
if SubStr($WebBrowserCommand,1,1)=""""
    {
    StringTrimLeft
        ,$WebBrowserCommand
        ,$WebBrowserCommand
        ,1

    ;-- Replace next occurance of DQ
    StringReplace
        ,$WebBrowserCommand
        ,$WebBrowserCommand
        ,"
    }

outputdebug After cleanup -  $WebBrowserCommand=%$WebBrowserCommand%


SplitPath $WebBrowserCommand,$WebBrowserProgram,$WebBrowserPath

;-- Get rid of extraneous parameters                   
t_SPos:=InStr($WebBrowserProgram,A_Space)
if t_SPos
    StringLeft $WebBrowserProgram,$WebBrowserProgram,t_SPos-1
        ;-- Note: Space is a weak delimiter for this test/StringLeft.  Can
        ;   probably be done better looking for an ".exe" in the string...


;---------------
;-- Final value
;---------------
blank = %$WebBrowserPath%\%$WebBrowserProgram%

run %blank% about:blank

return


Report this post
Top
 Profile  
Reply with quote  
PostPosted: June 19th, 2008, 6:08 am 
Offline

Joined: June 18th, 2008, 8:33 pm
Posts: 20
hesher wrote:
Hi,
I'd like to be able to start the default browser with a blank screen (actually, the default welcome page for that browser is also fine).


Answer:
Code:
run, http://www.fatwallet.com/redirect/bounce.php?url=about:blank


There's not an easily-accessible alias for the default browser, however, you can use a URL redirector. I was brainstorming for URL redirectors that I could think of. I know Google uses them when you click on Google search results, but applying it by editing the ?url= to about:blank gives an error message about redirecting to a blank page. So I used fatwallets, because I could think of it offhand, everybody needs to save money, and because they don't check for about:blank. Feel free to substitute fatwallet for another redirector if you can think of one.

_________________
ttrickyy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 6:29 am 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8666
Location: Salem, MA
Code:
run, iexplore.exe about:blank
run, firefox.exe about:blank


both worked for me without redirecting.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 6:34 am 
Offline

Joined: June 18th, 2008, 8:33 pm
Posts: 20
The problem with that is that it does not explicitly use the "default browser". I assumed that the original poster mentioned using the default browser instead of using firefox, etc, because of technical reasons on his end-- an example is the script having to work with different browsers on different computers: Opera, Maxthon, K-Meleon, etc. Not typical browsers.

[ Moderator!: Do not quote the previous post unneccessarily ]

_________________
ttrickyy


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 7:27 am 
Offline

Joined: May 29th, 2008, 11:33 am
Posts: 24
You assumed correctly :) I am trying to open the default browser.
for some reason I had the feeling that it would be as simple as using a predefined windows shortcut.
Thank you all!

[ Moderator!: Do not quote the previous post unneccessarily ]


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 9:13 am 
Offline

Joined: June 19th, 2008, 9:09 am
Posts: 2
Thanks for this information !

_________________
support @ vividtemplates.net
support @ VTDIZ.COM


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 11:33 am 
Offline

Joined: May 29th, 2008, 11:33 am
Posts: 24
By the way - Thank you trickyt. I'm going to use your method, its not utopia but its the cleanest solution :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 19th, 2008, 2:06 pm 
Offline

Joined: June 18th, 2008, 8:33 pm
Posts: 20
hesher wrote:
By the way - Thank you trickyt. I'm going to use your method, its not utopia but its the cleanest solution :)

No problem-- glad I could help.

_________________
ttrickyy


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: BrandonHotkey, poserpro, sjc1000, Tilter_of_Windmills, Yahoo [Bot] and 59 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group