I’m doing something similar. I have not tried an ms add-in yet, but it’s on my near-term roadmap.
What I have done is Adobe extensions/plugins. Adobe has two flavors. One (CEP) runs inside a CEF (Chromium Embedded Framework) environment. That works exactly like a normal web app and Royale runs without issues. The second (UXP) supports web APIs, but is not a fully compliant browser environment. I got it to work both for running and debugging, but I had to jump through some hoops. I’m not sure if any of this is applicable to you. If you need to load some js, I’d just add it to your html template file as a script tag. Not sure if my rambling is helpful... > On Oct 19, 2021, at 11:17 AM, Hugo Ferreira <[email protected]> wrote: > > Yes, I'm loading thru localhost. > I even have done code for debug purpose, to avoid the infamous cross domain > issue to be able to test on localhost. > > It's an Web Add-In for MS Word and testing outside of localhost means that > every single change must the uploaded to a server. > > I will test later load the Add-In from the server to confirm that this is > the issue. > > Thank you for the tip. > > Maria Jose Esteve <[email protected]> escreveu no dia terça, 19/10/2021 > à(s) 08:57: > >> Hi, It may seem silly Hugo, but... how are you running it? under the >> website or directly accessing the html? >> I'm doing some wrappers like you and I'm having problems with the >> execution through localhost, it doesn't load the js. Maybe this is your >> problem. >> >> Hiedra >> >> -----Mensaje original----- >> De: Hugo Ferreira <[email protected]> >> Enviado el: martes, 19 de octubre de 2021 2:49 >> Para: Apache Royale Development <[email protected]> >> Asunto: Strangled with a new Royale wrapper component >> >> Hi, >> >> I'm strangled with an issue. >> I'm developing a wrapper for office.js (office web add-In). >> >> I have this file OfficeAddIn.as in src root folder with the following >> content: >> >> package >> { >> import org.apache.royale.events.EventDispatcher; >> >> /** >> * @externs >> */ >> COMPILE::JS >> public class OfficeAddIn extends EventDispatcher { >> /** >> * <inject_script> >> * var script = document.createElement("script"); >> * script.setAttribute("src", "resources/office/office.js"); >> * document.head.appendChild(script); >> * </inject_script> >> */ >> public function OfficeAddIn(){} >> >> public static function writeData():void {} } } >> >> At runtime when I run the writeData method from actionscript code, I get >> the following error: ReferenceError: Can't find variable: OfficeAddIn >> >> It's not my first Royale wrapper and I copied from the first one. >> >> Thanks in advance, >> Hugo. >>
