URL specification change LC8.1 to LC9.x [RESOLVED]

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: URL specification change LC8.1 to LC9.x

Post by sritcp » Mon Jan 20, 2020 4:04 pm

Klaus wrote:
Mon Jan 20, 2020 3:39 pm
do not use:

Code: Select all

...
## put URLendcode(it) into tTemp
## Try with:
replace SPACE with "%20" in tTemp
...
These are different!
Klaus:
I can do that, but URL has no spaces (the filename is A101.pdf and I take care not to use any spaces in my folder names).
What happens if you open that PDF right in SAFARI?
The file opens with no problems! (The pdf file was made in Pages, but as my previous post shows, even a pdf from Adobe website breaks it!)

Sri
Last edited by sritcp on Mon Jan 20, 2020 11:18 pm, edited 3 times in total.

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: URL specification change LC8.1 to LC9.x

Post by Klaus » Mon Jan 20, 2020 4:23 pm

sritcp wrote:
Mon Jan 20, 2020 4:04 pm
The file opens with no problems!
And do you see the 4 buttons:
- (Zoom out)
+ "(Zoom in)
Open in Preview
Download
at the bottom of the PDF in SAFARI?
If yes, then Acrobat does not hook into your "webview".

Bugreport Acrobat Reader and Browser Widget:
https://quality.livecode.com/show_bug.cgi?id=22534

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: URL specification change LC8.1 to LC9.x

Post by sritcp » Mon Jan 20, 2020 4:54 pm

Hi Klaus:
When move the cursor to the bottom of the screen in Safari (with pdf file open),
the image with 4 options pops up (see attached). So, it is not Acrobat.

Sri.
Attachments
pdfInSafari.png
pdfInSafari.png (11.2 KiB) Viewed 6879 times

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: URL specification change LC8.1 to LC9.x

Post by Klaus » Mon Jan 20, 2020 5:11 pm

OK, just wanted to be sure!

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: URL specification change LC8.1 to LC9.x

Post by sritcp » Mon Jan 20, 2020 5:21 pm

Hi Klaus:

I had mentioned in an earlier post that when I opened
https://www.adobe.com/support/products/ ... xplain.pdf
in Safari, copied the URL and pasted it in the URL field of the browser widget, and changed from edit to run mode, LC crashed.

Does that happen to you, or are you able to load an pdf from the web without any problem?

Sri

Klaus
Posts: 13824
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: URL specification change LC8.1 to LC9.x

Post by Klaus » Mon Jan 20, 2020 5:32 pm

I can load that Adobe PDF into a browswer widget without any problem:

Code: Select all

on mouseUp
   set the url of widget 1 to "https://www.adobe.com/support/products/enterprise/knowledgecenter/media/c4611_sample_explain.pdf"
end mouseUp

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: URL specification change LC8.1 to LC9.x

Post by jacque » Mon Jan 20, 2020 6:49 pm

I had a related issue yesterday. SpecialFolderPath preceeds the URL with a slash, so if you use "file://" in the URL you get three slashes at the front. This worked fine on Mac, Android, and in the iOS simulator (which uses Mac file paths) but failed on a real iPhone. To fix it I needed to use "file:" with no slashes. I'm loading an html file from disk into the browser widget but the general idea should be the same.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: URL specification change LC8.1 to LC9.x

Post by sritcp » Mon Jan 20, 2020 8:46 pm

I have tried the following:
1. "/Users/JohnDoe/MyData/A101.pdf"
2. "file:///Users/JohnDoe/MyData/A101.pdf"
3. "file:/Users/JohnDoe/MyData/A101.pdf"
4. Running each of the above through URLencode()
5. Running each through replace " " with "%20"

In all cases, LC9.5.1 on MacOS10.14.6 crashes.

* The problem pertains only to pdf files.
Setting the URL to an html page on the web, or setting the htmlText of widget "Browser" to a local html file works.

* The problem pertains only LC9.5.1
LC8.1 loads these same pdf files with no problem

* The problem pertains to my Mac, not Klaus's
This is annoying! This means there is something on my computer that is messing with pdf file loading. Acrobat Reader is not my default pdf loader; No Adobe program is running. I have Adobe Creative Cloud installed on my computer. May be there are some Adobe CC files running in the background which are causing this problem

Is there any way of debugging what actually happens between when the URL is set and LC crashes out?

Thanks,
Sri

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9823
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: URL specification change LC8.1 to LC9.x

Post by FourthWorld » Mon Jan 20, 2020 8:52 pm

sritcp wrote:
Mon Jan 20, 2020 8:46 pm
I have tried the following:
1. "/Users/JohnDoe/MyData/A101.pdf"
2. "file:///Users/JohnDoe/MyData/A101.pdf"
3. "file:/Users/JohnDoe/MyData/A101.pdf"
4. Running each of the above through URLencode()
5. Running each through replace " " with "%20"
If you open the PDF in your browser, what URL does it show?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

LCMark
Livecode Staff Member
Livecode Staff Member
Posts: 1208
Joined: Thu Apr 11, 2013 11:27 am

Re: URL specification change LC8.1 to LC9.x

Post by LCMark » Mon Jan 20, 2020 9:04 pm

Most likely it is Acrobat Reader which is being loaded by the (system) WebView used by LC - Safari does (and always has) done its own thing (i.e. WebViews you get in apps is not Safari - not necessarily even the same system 'WebKit' framework underneath!).

The reason I think this is because: https://quality.livecode.com/show_bug.cgi?id=22534

In terminal do:

Code: Select all

open ~/Library/Internet\ Plug-Ins/
And see if there's anything Adobe-looking in there.

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: URL specification change LC8.1 to LC9.x

Post by sritcp » Mon Jan 20, 2020 9:27 pm

FourthWorld wrote:
Mon Jan 20, 2020 8:52 pm
If you open the PDF in your browser, what URL does it show?
file:///Users/MyName/PiaData/activities/A101.pdf

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: URL specification change LC8.1 to LC9.x

Post by sritcp » Mon Jan 20, 2020 9:32 pm

LCMark wrote:
Mon Jan 20, 2020 9:04 pm
In terminal do:

Code: Select all

open ~/Library/Internet\ Plug-Ins/
And see if there's anything Adobe-looking in there.
I did; it opened the Internet Plug-Ins window; no Adobe items. In fact, the only entry is "Dish Anywhere Player.plugin"!

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: URL specification change LC8.1 to LC9.x

Post by matthiasr » Mon Jan 20, 2020 9:46 pm

sritcp wrote:
Mon Jan 20, 2020 9:32 pm
I did; it opened the Internet Plug-Ins window; no Adobe items. In fact, the only entry is "Dish Anywhere Player.plugin"!
Hi,
could please in terminal do

Code: Select all

open /library/internet\ Plug-Ins/
I have the same problem and in my case i found 3 "Adobe-looking" files in /library/Internet Plug-Ins/:

AdobeAAMDetect.plugin
AdobePDFViewer.plugin
AdobePDFViewerNPAPI.plugin

I´ve moved the AdobePDFViewer... files to the folder "Disabled Plug-Ins".

I´ve then restarted LC and i did not run into the problem anymore.

sritcp
Posts: 431
Joined: Tue Jun 05, 2012 5:38 pm
Location: Alexandria, Virginia

Re: URL specification change LC8.1 to LC9.x [RESOLVED]

Post by sritcp » Mon Jan 20, 2020 11:16 pm

Matthias:

It worked!

By the way the terminal command only shows the plug-ins in the user library.
So, I did not see these Adobe plug-ins the first time.
I used the Finder to go to System Library/ internet plugins folder and there they were!

(I do wonder whether this problem will occur if a user of the app has these plugins installed on their computer? If so, that would put a serious crimp on using the browser widget in standalone apps)

Thanks everyone for your help! This one ran me around for a while!

Regards,
Sri

matthiasr
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 190
Joined: Sat Apr 08, 2006 7:55 am
Location: Lübbecke, Germany
Contact:

Re: URL specification change LC8.1 to LC9.x [RESOLVED]

Post by matthiasr » Tue Jan 21, 2020 12:00 am

By the way the terminal command only shows the plug-ins in the user library.
Correct, the terminal command Mark asked you to run opened the folder in the user library,
while the command i asked you to run should have opened the folder in the system library folder.
(I do wonder whether this problem will occur if a user of the app has these plugins installed on their computer? If so, that would put a serious crimp on using the browser widget in standalone apps)
Unfortunately this is currently the case, but as Mark mentioned there is already a report for it in the Quality Center which is already confirmed.
https://quality.livecode.com/show_bug.cgi?id=22534
I´ve added the information about the .plugins to it.

You could add your e-mail adress there to get informed about the progress.

Regards,
Matthias

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”