Here’s it in use in an actual app:
<js:WebBrowser width="100%" height="100%" id="browser" url="{url}" />
I also have this code on intiComplete:
browser.addEventListener("locationChanged",locationChanged);
(browser.element as HTMLIFrameElement).sandbox =
"allow-top-navigation allow-forms allow-scripts allow-same-origin";
If you need more extensive communication, take a look at postMessage:
https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
<https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage>
HTH,
Harbs
> On Dec 17, 2019, at 6:51 AM, Greg Dove <[email protected]> wrote:
>
> Sorry, I don't know of any. That class looked like it was intended for what
> you needed, but I have not used it myself. When I needed the type of thing
> that you described in the past, I wrote a custom component to do that, but it
> looked like WebBrowser had part of the setup I had used when I did that.
> I just pushed a quick fix for startup url value assignment.
> I was able to get it displaying something that way with this:
>
> <js:WebBrowser url="https://royale.apache.org/ <https://royale.apache.org/>"
> width="400" height="400"/>
>
>
> it seems that both Alex and Harbs have worked on that. Maybe they can
> provide more info.
>
>
> On Tue, Dec 17, 2019 at 4:47 PM Takeshita Shoichiro <[email protected]
> <mailto:[email protected]>> wrote:
> Greg, is there any sample code snippet to use WebBrowser.as?
>
> 2019年12月17日(火) 12:10 Greg Dove <[email protected]
> <mailto:[email protected]>>:
> I was just looking at the original lib. It has a bunch of extra api methods
> etc. It might need some effort to add in the various ExternalInterface calls
> that the original lib had if you need those. But basically, the Flex lib was
> reaching out to html to do this. In Royale you are already 'closer' to the
> iframe, so it should be relatively easy.
>
>
> On Tue, Dec 17, 2019 at 4:06 PM Takeshita Shoichiro <[email protected]
> <mailto:[email protected]>> wrote:
> Greg, thanks for a good news. Will try.
>
> 2019年12月17日(火) 12:04 Greg Dove <[email protected]
> <mailto:[email protected]>>:
> That should be quite easy.
>
> Either it should be easy to do it directly, or it looks like you could use:
> org.apache.royale.html.WebBrowser
> from Basic lib.
> I did not use this yet, but it seems like it should be what you need.
>
>
> On Tue, Dec 17, 2019 at 4:00 PM Takeshita Shoichiro <[email protected]
> <mailto:[email protected]>> wrote:
> Hi,
>
> Our application uses this library extensively to display page-size image as
> embedded.
>
> How it would be easy or difficult to make it work in Royale?
> --
> Shoichiro Takeshita
> 武下 祥一郎
> --
> Shoichiro Takeshita
> 武下 祥一郎
> --
> Shoichiro Takeshita
> 武下 祥一郎