Using non default browser

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
User avatar
Nick
Posts: 51
Joined: Fri Aug 22, 2003 7:12 am
Location: Newcastle under Lyme, UK
Contact:

Using non default browser

Post by Nick »

Is it possible to set a different browser for the View>In Web Browser command so that it does not use the default browser? If so, how?
Cheers, Nick
www.square-sun.net
SteveW
Posts: 3
Joined: Wed Jul 02, 2014 10:45 am

Post by SteveW »

You could change the default browser itself in windows control panel.Other than that though you could set any other browser as a "tool" in TextPad.

You can do this by going to Configure > Preferences > Tools > Add > Program... and navigating to the application file of the browser ( ending in *.exe and usually found in a folder under "Program Files" for example internet explorer would be C:\Program Files\Internet Explorer\iexplore.exe). Then click "Apply".

Go to the specific tools settings(found by clicking the "+" next to tools) and tick the "Save All documents first" checkbox.

After you have changed all the settings you want, press OK and the browser should be found under the tools menu and can be more quickly accessed by the keyboard shortcut it displays on the menu
User avatar
Nick
Posts: 51
Joined: Fri Aug 22, 2003 7:12 am
Location: Newcastle under Lyme, UK
Contact:

Post by Nick »

Thanks, I hadn't thought of that. I've now done this, but with php files it displays the text of the php file, whereas "In Web Browser" displays the page as served by Apache. Not sure how to set the parameters to achieve this.
Cheers, Nick
www.square-sun.net
SteveW
Posts: 3
Joined: Wed Jul 02, 2014 10:45 am

Post by SteveW »

Does the web address in the browser look different?

Maybe adding something in front of $FileName in the parameters would solve the problem. I see in this locally hosted version of apache it has "localhost:8082":
http://blog.cloudfoundry.com/wp-content ... 7Local.png
ben_josephs
Posts: 2461
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

How about (since you are using PHP) something like this:
Command: C:\PHP\php.exe
Parameters: C:\path\to\viewinbrowser.php $File
Initial folder:

[X] Run minimized
[X] Closee DOS window on exit
where C:\path\to\viewinbrowser.php is (with details changed as appropriate)

Code: Select all

<?php
$url = preg_replace ( '/.*\\\\htdocs\\\\/', 'localhost\\', $argv[ 1 ] ) ;
system ( "\"C:/Program Files (x86)/Mozilla Firefox/firefox.exe\" \"$url\"" ) ;
?>
User avatar
Nick
Posts: 51
Joined: Fri Aug 22, 2003 7:12 am
Location: Newcastle under Lyme, UK
Contact:

Post by Nick »

Gave up on the idea and set a tool to launch the browser with the $URL parameter. Works fine. I would have just found it more convenient to be able to set the 'View in web browser' button to a different browser than the default one.
Cheers, Nick
www.square-sun.net
Post Reply