widget Browser not opening URL with picture

The place to discuss anything and everything about running your LiveCode on Android

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller, robinmiller

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

widget Browser not opening URL with picture

Post by Youks » Mon Nov 26, 2018 8:30 pm

Hi All,

After some testing I am unable to open an URL containing a GIF or JPEG with the widget whereas it works properly when creating a mobile browser, any known issues ?
By the way is it possible to load a GIF or JPEG through the browser, rotate the picture and display it back through the browser?

Thx in advanve.

Best regards

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: widget Browser not opening URL with picture

Post by [-hh] » Mon Nov 26, 2018 9:10 pm

Sometimes the browser widget can't load "https:"-addresses. Try as "http:" or try to set the userAgent of the widget.
Images in the browser can be rotated directly in the browser using CSS (do "..." in widget "browser").
shiftLock happens

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

Re: widget Browser not opening URL with picture

Post by FourthWorld » Mon Nov 26, 2018 9:27 pm

[-hh] wrote:
Mon Nov 26, 2018 9:10 pm
Sometimes the browser widget can't load "https:"-addresses. Try as "http:" or try to set the userAgent of the widget.
Images in the browser can be rotated directly in the browser using CSS (do "..." in widget "browser").
Do we have a bug report on that? HTTPS adoption is growing rapidly.
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: widget Browser not opening URL with picture

Post by Youks » Mon Nov 26, 2018 9:43 pm

Hi Hernann,
Thx surprisingly the "http" vs "https" did the trick but i think it should be fixed or mentioned.
Could you kindly provide a hint regarding the userAgent method?

Being a total noob in java , will anything like (do" transform....rotate...") do what expected or is it a little more complex?

Thanks a million !

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: widget Browser not opening URL with picture

Post by [-hh] » Mon Nov 26, 2018 10:02 pm

Hi Youks,
please report the address of the image that didn't load by "https:" to
https://quality.livecode.com
so that they can look into it.
Or post the address here.
This is probably a situation when "ordinary" browsers open a security dialog...
(I checked just now that for example on Mac the widget sets the same userAgent as Safari, so that's not the reason.)
shiftLock happens

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: widget Browser not opening URL with picture

Post by Youks » Mon Nov 26, 2018 10:16 pm

Done.
Bug 21716 submitted .

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: widget Browser not opening URL with picture

Post by [-hh] » Mon Nov 26, 2018 10:30 pm

Rotate an image in the browser widget.

Code: Select all

on mouseUp
  set htmltext of widget "browser" to fld "HTML"
  put "var d=document.getElementById('youks1');" & \
        "d.setAttribute('style','" & \
        "-webkit-transform:rotate(90deg); transform:rotate(90deg);" & \
        "transform-origin:50% 50%;')" into js
  do js in widget "Browser"
end mouseUp
fld "HTML":
<html><head></head><body>
<div id='youks1'><img src='http://hyperhh.de/TEST/Buchenberg640x480.png' alt='Rock my soul'></div>
</body></html>
shiftLock happens

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: widget Browser not opening URL with picture

Post by Youks » Mon Nov 26, 2018 11:02 pm

Thank you so much Hermann!

It's a great start to understand how this works! I have put that into place , the picture shows up but temporarily rotates after few mouseUp and regains initial state. Is that what it is supposed to do or a step is missing?

Regards
Last edited by Youks on Tue Nov 27, 2018 6:05 am, edited 1 time in total.

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: widget Browser not opening URL with picture

Post by Youks » Mon Nov 26, 2018 11:21 pm

Disregard my last comment !!!

I set the URL in an openCard and use the button only for the rotation and it works great!!! Thank you so much !! You Rock !! :D

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2262
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: widget Browser not opening URL with picture

Post by [-hh] » Mon Nov 26, 2018 11:44 pm

This should work also in one go. But it's better to separate the call for the htmltext.

You could also use "load url" on openCard, so users with a slow connection get more time.
And later on (when the image is no longer needed) use "unload url".
Then the image is loaded (fast) from cache every time you set the htmltext.

p.s. Did you already try to use widget imageWidget (see "Sample Stacks")?
It loads also remote sources and rotation is very easy. And you don't need javaScript for that.
shiftLock happens

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: widget Browser not opening URL with picture

Post by Youks » Tue Nov 27, 2018 5:54 am

No Hermann, I haven't explored the imageWidget....Ahhh I have just noticed it ......I'll try it !! Thx......

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: widget Browser not opening URL with picture

Post by Youks » Tue Nov 27, 2018 6:33 am

Amazing Job !!! Thank you!! :D

Youks
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 135
Joined: Mon Sep 05, 2011 6:08 pm
Location: Qatar

Re: widget Browser not opening URL with picture

Post by Youks » Tue Nov 27, 2018 9:04 am

Dear Hermann,

I couldn't make the imageWidget work on android. I have created a single card with the widget and the preloaded picture but when built the card is empty.

PS: tried LC9.01 & 9.0.2 RC1 and minimum built KitKat 4.4

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 698
Joined: Fri Feb 06, 2015 4:03 pm

Re: widget Browser not opening URL with picture

Post by LiveCode_Panos » Tue Nov 27, 2018 10:24 am

Hello all,

If you use a https URL with the browser widget, you have to make sure you include the "SSL and Encryption" lib in the standalone. This is done in the "Inclusions" pane.

I will update the bug report.

Kind regards,
Panos
--

LiveCode_Panos
Livecode Staff Member
Livecode Staff Member
Posts: 698
Joined: Fri Feb 06, 2015 4:03 pm

Re: widget Browser not opening URL with picture

Post by LiveCode_Panos » Tue Nov 27, 2018 10:29 am

Hmm I just tested and I can successfully load the image (i.e. the https URL) in the browser widget, either with or without the "SSL and Encryption" library.

What does the browser widget display for you when the image does not load?

Kind regards,
Panos
--

Post Reply

Return to “Android Deployment”