LC8 Browser Widget / PDF
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
LC8 Browser Widget / PDF
Hi all,
I'v been playing with LC8 for a while now although I frequently find myself reverting to 7 due to erratic IDE crashes - sometimes 5 or 6+ a day...
Anyways, I made the move to 8 chasing widgets, more specifically the Browser Widget and the PDF display widget (one and the same maybe as per LC7). I'd seen various posts for the LC 8 expounding the simplicity of widgets and PDF display etc so made my move...
Indeed the LC8 Browser widget is sooooooo much simpler to use / less involved that the older revBrowser (revBrowserCEF) BUT I'm experiencing some issues :
[1] Often ( >1 in 4 times) the browser simply refuses to show itself. I can often (but not always) get it to do so by cycling its 'visible' property but... only 1/2 the time... Generally, exiting LC8 and restarting fixes the issue but whilst that's OK (to a point) for me it's most definitely a hack and no good for others / not a long term solution.
[2] I simply cannot, whatever I do make the browser display a PDF. I've tried :
set the url of widget "wgtBrowser" to ("file://" & URLEncode (my_full_file_path)
set the url of widget "wgtBrowser" to ("file:/" & URLEncode (my_full_file_path)
set the url of widget "wgtBrowser" to ("file:" & URLEncode (my_full_file_path)
and I don't know what else... I've even renamed my file to something like "PDF.pdf", in an attempt to make sure it's not a naming convention issue...
Nothing is reported if I "put the result" or "put it" immediately after my attempt to display the file (both "it" and "result" are empty).
If, however, I deliberately mis-spell the file name / path then I do get an error !
Generally, I simply get a white rectangle (the size / rect of the browser widget) and nothing else...
Anyone any experience with [1] the unwillingness of the browser to display itself or [2] any luck with displaying PDFs please ? I'm really hoping it won't be necessary to revert to 'revBrowser' with its windowIDs and BrowserIDs etc... (backward step for me and rather defeating the object to moving to LC8).
Hope someone can kick me in the right direction.
Have a great weekend. Thanks a million.
I'v been playing with LC8 for a while now although I frequently find myself reverting to 7 due to erratic IDE crashes - sometimes 5 or 6+ a day...
Anyways, I made the move to 8 chasing widgets, more specifically the Browser Widget and the PDF display widget (one and the same maybe as per LC7). I'd seen various posts for the LC 8 expounding the simplicity of widgets and PDF display etc so made my move...
Indeed the LC8 Browser widget is sooooooo much simpler to use / less involved that the older revBrowser (revBrowserCEF) BUT I'm experiencing some issues :
[1] Often ( >1 in 4 times) the browser simply refuses to show itself. I can often (but not always) get it to do so by cycling its 'visible' property but... only 1/2 the time... Generally, exiting LC8 and restarting fixes the issue but whilst that's OK (to a point) for me it's most definitely a hack and no good for others / not a long term solution.
[2] I simply cannot, whatever I do make the browser display a PDF. I've tried :
set the url of widget "wgtBrowser" to ("file://" & URLEncode (my_full_file_path)
set the url of widget "wgtBrowser" to ("file:/" & URLEncode (my_full_file_path)
set the url of widget "wgtBrowser" to ("file:" & URLEncode (my_full_file_path)
and I don't know what else... I've even renamed my file to something like "PDF.pdf", in an attempt to make sure it's not a naming convention issue...
Nothing is reported if I "put the result" or "put it" immediately after my attempt to display the file (both "it" and "result" are empty).
If, however, I deliberately mis-spell the file name / path then I do get an error !
Generally, I simply get a white rectangle (the size / rect of the browser widget) and nothing else...
Anyone any experience with [1] the unwillingness of the browser to display itself or [2] any luck with displaying PDFs please ? I'm really hoping it won't be necessary to revert to 'revBrowser' with its windowIDs and BrowserIDs etc... (backward step for me and rather defeating the object to moving to LC8).
Hope someone can kick me in the right direction.
Have a great weekend. Thanks a million.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
-
- Livecode Staff Member
- Posts: 861
- Joined: Fri Feb 06, 2015 4:03 pm
Re: LC8 Browser Widget / PDF
Hi Traxgeek,
Have you tried:
Best,
Panos
--
Have you tried:
Code: Select all
set the url of widget "wgtBrowser" to my_full_file_path
Panos
--
Re: LC8 Browser Widget / PDF
Hi Panos,
Thanks for your suggestion. I'm losing track of what I have and have not tried now. This is not made any simpler by the fact that, like I say, 50% of the time the browser widget doesn't show / appear anyways... This morning, my semi-trusty hack of toggling the visible property from the Project Browser pane doesn't work either.
To answer your specific suggestion, I have now tried that and that doesn't appear to work for me either. So far I have tried (this morning) :
##set the url of widget "brsPDFBrowser" to ("file://" & URLEncode (sFilePath & "/" & sFile))
##put "1: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
set the url of widget "brsPDFBrowser" to ("file:/" & URLEncode (sFilePath & "/" & sFile))
put "2: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser" --FLASHED UP A BLACK 'BUTTON' TOWARDS THE BOTTOM OF THE WIDGET AND THEN DISAPPEARED
##set the url of widget "brsPDFBrowser" to ("file:" & URLEncode (sFilePath & "/" & sFile))
##put "3: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to ("file://" & sFilePath & "/" & sFile)
##put "4: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to ("file:/" & sFilePath & "/" & sFile)
##put "5: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to ("file:" & sFilePath & "/" & sFile)
##put "6: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the htmltext of widget "brsPDFBrowser" to ("file://" & URLEncode (sFilePath & "/" & sFile))
##put "7: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to URLEncode (sFilePath & "/" & sFile)
##put "8: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to sFilePath & "/" & sFile
##put "9: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to (sFilePath & "/" & sFile)
##put "10: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
The double 'hash' is me simply rem-ing out an attempt that hasn't worked. The 'put' line simply displays the result of the 'set URL' op and confirms the address I believe I've set...
Interestingly, if I fire up a simple widget browser and, say, navigate to google and then type in :
//path_to_my_file & "/" & my_PDF-to_display, I simply get the blank (white) browser page again.
Same happens with various other versions (with / without the leading slashes etc...) I simply end up with a blank (white) browser page... which then refuses to display anything at all - even the previous google page should I try and navigate back to it or even, re-type a fresh url !!! Grrrrr...
Even more interesting :
Should I fire up Safari and paste my file path in to it with the two preceding slashes, I get a similar blank page... hmmm...
However, should I fire up Chrome (on the same Mac), I do get my pdf displayed in all of its wonderous splendour !!!
Now, I don't know how the LC8 widget invokes itself / binds itself to BUT, if it were my default browser (which, arguably, could be considered fair) then maybe this is a Safari / Adobe issue. So, before I go any further and make this rather long response even longer I'll go change my default browser and then update ...
Again, thanks a mil for having taken the time - appreciated.
IAN
Thanks for your suggestion. I'm losing track of what I have and have not tried now. This is not made any simpler by the fact that, like I say, 50% of the time the browser widget doesn't show / appear anyways... This morning, my semi-trusty hack of toggling the visible property from the Project Browser pane doesn't work either.
To answer your specific suggestion, I have now tried that and that doesn't appear to work for me either. So far I have tried (this morning) :
##set the url of widget "brsPDFBrowser" to ("file://" & URLEncode (sFilePath & "/" & sFile))
##put "1: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
set the url of widget "brsPDFBrowser" to ("file:/" & URLEncode (sFilePath & "/" & sFile))
put "2: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser" --FLASHED UP A BLACK 'BUTTON' TOWARDS THE BOTTOM OF THE WIDGET AND THEN DISAPPEARED
##set the url of widget "brsPDFBrowser" to ("file:" & URLEncode (sFilePath & "/" & sFile))
##put "3: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to ("file://" & sFilePath & "/" & sFile)
##put "4: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to ("file:/" & sFilePath & "/" & sFile)
##put "5: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to ("file:" & sFilePath & "/" & sFile)
##put "6: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the htmltext of widget "brsPDFBrowser" to ("file://" & URLEncode (sFilePath & "/" & sFile))
##put "7: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to URLEncode (sFilePath & "/" & sFile)
##put "8: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to sFilePath & "/" & sFile
##put "9: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
##set the url of widget "brsPDFBrowser" to (sFilePath & "/" & sFile)
##put "10: " & the result & " >>> " & it & cr & the url of widget "brsPDFBrowser"
The double 'hash' is me simply rem-ing out an attempt that hasn't worked. The 'put' line simply displays the result of the 'set URL' op and confirms the address I believe I've set...
Interestingly, if I fire up a simple widget browser and, say, navigate to google and then type in :
//path_to_my_file & "/" & my_PDF-to_display, I simply get the blank (white) browser page again.
Same happens with various other versions (with / without the leading slashes etc...) I simply end up with a blank (white) browser page... which then refuses to display anything at all - even the previous google page should I try and navigate back to it or even, re-type a fresh url !!! Grrrrr...
Even more interesting :
Should I fire up Safari and paste my file path in to it with the two preceding slashes, I get a similar blank page... hmmm...
However, should I fire up Chrome (on the same Mac), I do get my pdf displayed in all of its wonderous splendour !!!
Now, I don't know how the LC8 widget invokes itself / binds itself to BUT, if it were my default browser (which, arguably, could be considered fair) then maybe this is a Safari / Adobe issue. So, before I go any further and make this rather long response even longer I'll go change my default browser and then update ...
Again, thanks a mil for having taken the time - appreciated.
IAN
Last edited by Traxgeek on Sun Feb 05, 2017 12:43 pm, edited 1 time in total.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Re: LC8 Browser Widget / PDF
Nope, that didn't help !
I just removed the Adobe plugins from Safari AND reset my default browser to Chrome, cycled the power on my Mac and... no difference... just a blank browser page.
Interestingly enough the Browser now refuses to display ANYTHING again...
The browser widget is definitely there, I can cycle it's visible property from the Project Browser or via a 'test' button script but I can't for the life of me get it to display anything now apart form its grey background globe image when inactive...
I'm really not sure anymore if this is a 'Me' thing or a LC8 / Browser thing...
I just removed the Adobe plugins from Safari AND reset my default browser to Chrome, cycled the power on my Mac and... no difference... just a blank browser page.
Interestingly enough the Browser now refuses to display ANYTHING again...
The browser widget is definitely there, I can cycle it's visible property from the Project Browser or via a 'test' button script but I can't for the life of me get it to display anything now apart form its grey background globe image when inactive...
I'm really not sure anymore if this is a 'Me' thing or a LC8 / Browser thing...

I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Re: LC8 Browser Widget / PDF
I don't know for sure but I recall mention of an issue with pdf files being displayed in a browser at all, which you have seen some symptoms of in your trial. I believe it's to do with modern browser development disabling plug ins, and/or not allowing hard coded local file paths - requiring user intervention to select a local file. IIRC it depends on the browser version what exactly happens but the browser widget is based on safari??? which you have found displays the blank window.
Perhaps someone can confirm or shed more light?
Perhaps someone can confirm or shed more light?
Re: LC8 Browser Widget / PDF
Thanks SparkOut - appreciated.
I recall a video presentation from Kevin that showed this sort of thing working and my 'interpretation' of such was that the new Browser widget would simply... 'work', ditto a widget for displaying PDFs (if that couldn't be handled from the browser). Indeed, Kevin demo'ed a 15 minute PDF widget implementation which I had assumed would (by now - there's already a lot of hype re: LC9) be 'up and running'... and I found a speed test comparing the LC7 revBrowser and the LC8 widget browser... but little useful info there... seems neither may be available yet...
It's a little odd, like you say, if indeed the LC8 widget browser is based / wrapped around / uses the underlying Safari-esque browser then I guess that could be the reason. All sorts of apparent work-arounds on the web for Safari but, having tried two of them, they don't seem to work here for me with Mac and Sierra...
Forcing my default browser to Chrome hasn't helped, although Chrome displays the pdf's perfectly (from within itself) if the full file path is entered...
Like you say, anyone able to shed more light please ? Even a brief Widget Browser tutorial would be helpful. The dictionary seems very light on this type of topic at the moment...
As always, thanks anyways.
IAN
I recall a video presentation from Kevin that showed this sort of thing working and my 'interpretation' of such was that the new Browser widget would simply... 'work', ditto a widget for displaying PDFs (if that couldn't be handled from the browser). Indeed, Kevin demo'ed a 15 minute PDF widget implementation which I had assumed would (by now - there's already a lot of hype re: LC9) be 'up and running'... and I found a speed test comparing the LC7 revBrowser and the LC8 widget browser... but little useful info there... seems neither may be available yet...
It's a little odd, like you say, if indeed the LC8 widget browser is based / wrapped around / uses the underlying Safari-esque browser then I guess that could be the reason. All sorts of apparent work-arounds on the web for Safari but, having tried two of them, they don't seem to work here for me with Mac and Sierra...
Forcing my default browser to Chrome hasn't helped, although Chrome displays the pdf's perfectly (from within itself) if the full file path is entered...
Like you say, anyone able to shed more light please ? Even a brief Widget Browser tutorial would be helpful. The dictionary seems very light on this type of topic at the moment...
As always, thanks anyways.
IAN
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
-
- Livecode Staff Member
- Posts: 861
- Joined: Fri Feb 06, 2015 4:03 pm
Re: LC8 Browser Widget / PDF
Hi all,
I have tried the sample stack attached by Klaus in this thread http://forums.livecode.com/viewtopic.php?f=7&t=28708, and the PDF is displayed as expected. See the script of the button for more details.
Best,
Panos
--
I have tried the sample stack attached by Klaus in this thread http://forums.livecode.com/viewtopic.php?f=7&t=28708, and the PDF is displayed as expected. See the script of the button for more details.
Best,
Panos
--
Re: LC8 Browser Widget / PDF
Hi Panos,
Thanks for that - I'll go take a look right now.
I searched (obviously not hard / long enough
) for other mentions / posts... missed Klaus's...
I'll revert once I've more info (others may find it helpful in the future).
Thanks again.
Thanks for that - I'll go take a look right now.
I searched (obviously not hard / long enough

I'll revert once I've more info (others may find it helpful in the future).
Thanks again.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Re: LC8 Browser Widget / PDF
OK... real simple...
Delete the existing widget and drag a new one onto the card... et voila, ca marche tres bien !!
I downloaded Klaus's test stack to my Mac, ran it... and it worked (what else does one expect from Klaus ? !!). Anyways, that got me thinking... maybe, because my desktop was on LC8.1.3 (this is the one Klaus's test stack works on) and my MacBook on 8.1.2, just maybe there was issue there... Switched my MacBook to 8.1.3 and... nope... hmmm...
deleted the original widget and dragged across a new one, named it so that it 'fitted' my code and... voila ! Parfait / Perfect
Thank you Panos and Klaus !! indebted to you both.
Delete the existing widget and drag a new one onto the card... et voila, ca marche tres bien !!
I downloaded Klaus's test stack to my Mac, ran it... and it worked (what else does one expect from Klaus ? !!). Anyways, that got me thinking... maybe, because my desktop was on LC8.1.3 (this is the one Klaus's test stack works on) and my MacBook on 8.1.2, just maybe there was issue there... Switched my MacBook to 8.1.3 and... nope... hmmm...




Thank you Panos and Klaus !! indebted to you both.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1