Offline usage of Linux LC-Python browser

Bob Warren bobwarren at howsoft.com
Thu Dec 18 18:16:29 EST 2014


A number of you have recently downloaded the Linux LC-Python Browser 
demo available at:

http://www.howsoft.com/runrev/extensions/

(If you have visited this page recently, and you now see no changes - 
i.e. the old version is still in the browser cache - then please refresh 
the page.)

The version you downloaded demonstrates on-line usage by navigating to a 
web page on the Internet. However, perhaps an even more common usage of 
an embedded browser is to display OFF-line web pages that are not on the 
Internet, e.g. when building a Help data base. Hence, there is now a 
second demo for download on the extensions page which demonstrates such 
off-line usage.

The little fly in the ointment solved by the new demo is that to call an 
off-line web page in Python, you have to supply an absolute (complete) 
URL path in the script, even when the web page is in the same folder as 
the script (as in the demo), e.g:

view.open("file:///home/bob/Desktop/_Proj_2014_V/Demos and 
Experiments/Python Browser Demo OFFLINE ONLY/demo/webpage.htm")

Statements like this do NOT work:

view.open("webpage.htm")
view.open("file://webpage.htm")
view.open("file:///webpage.htm")

The additional off-line demo therefore obtains the current defaultFolder 
(the program/webpage folder) and updates each Python script with it 
before it is fired.






More information about the use-livecode mailing list