Andrew, there are some CORs related console errors with this, but it might be a good starting point:
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009" initialize="onInit" xmlns:js="library://ns.apache.org/royale/basic" > <fx:Script><![CDATA[ private function onInit():void{ COMPILE::JS{ (iframe.element as HTMLIFrameElement).sandbox = "allow-top-navigation allow-forms allow-scripts allow-same-origin"; } } ]]></fx:Script> <js:valuesImpl> <js:SimpleCSSValuesImpl /> </js:valuesImpl> <js:initialView> <js:View width="100%" height="100%"> <js:WebBrowser localId="iframe" url="https://royale.apache.org/" width="50%" height="100%"/> </js:View> </js:initialView> </js:Application> Combines what Harbs said for init, plus a few other mandatory things. On Wed, Dec 18, 2019 at 9:19 AM Andrew Wetmore <cottag...@gmail.com> wrote: > Harbs, can I turn this into a tutorial for the Royale blog? > > On Tue, Dec 17, 2019 at 3:58 PM Harbs <harbs.li...@gmail.com> wrote: > >> Try changing js:WebBrowser to j:WebBrowser. >> >> The prefix needs the namespace you used for “j”. >> >> On Dec 17, 2019, at 2:59 PM, Takeshita Shoichiro <jl03...@gmail.com> >> wrote: >> >> Greg and Harbs, thanks. >> >> As I do not fully understand the Royale markup at moment. Unfortunately, >> the following markup does not show the Royale Website. What's wrong with >> it? >> And if I want to display image, using source ="test.jpg" is fine? >> >> Appreciate your all help in advance. >> >> >> =========================================================================================== >> <?xml version="1.0" encoding="utf-8"?> >> <j:Application xmlns:fx="http://ns.adobe.com/mxml/2009" >> xmlns:j="library://ns.apache.org/royale/basic" >> xmlns:js="org.apache.royale.html.*"> >> >> <js:WebBrowser width="100%" height="100%" id="browser" url=" >> https://royale.apache.org/" /> >> >> </j:Application> >> >> On Tue, Dec 17, 2019 at 4:05 PM Harbs <harbs.li...@gmail.com> wrote: >> >>> 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 >>> HTH, >>> Harbs >>> >>> On Dec 17, 2019, at 6:51 AM, Greg Dove <greg.d...@gmail.com> 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/" 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 <jl03...@gmail.com> >>> wrote: >>> >>>> Greg, is there any sample code snippet to use WebBrowser.as? >>>> >>>> 2019年12月17日(火) 12:10 Greg Dove <greg.d...@gmail.com>: >>>> >>>>> 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 <jl03...@gmail.com> >>>>> wrote: >>>>> >>>>>> Greg, thanks for a good news. Will try. >>>>>> >>>>>> 2019年12月17日(火) 12:04 Greg Dove <greg.d...@gmail.com>: >>>>>> >>>>>>> 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 < >>>>>>> jl03...@gmail.com> 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 >>>> 武下 祥一郎 >>>> >>> >>> >> >> -- >> Shoichiro Takeshita >> 武下 祥一郎 >> >> >> > > -- > Andrew Wetmore > > http://cottage14.blogspot.com/ > > > > >