sal88 2 Posted June 2, 2020 Share Posted June 2, 2020 Hi all I'm trying to integrate draw.io in to my solution via the web viewer. I have much to learn as I have new to javascript. I have managed to get it to execute a filemaker script though. My first real issue is that it does not seem to work fully in the webviewer. I've downloaded these files https://github.com/jgraph/drawio-integration I can open localfile.html in my usual browser and it works fine. However within FileMaker's web viewer it does open (the url is "data:text/html," & [global field containing source code of localfile.html]), but functionality is limited. I can't add any shapes to the canvas for example. Any help appreciated. Thank you! Link to post Share on other sites
sal88 2 Posted June 7, 2020 Author Share Posted June 7, 2020 I've just realised that the problem occurs regardles of whether I integrate the modified html files. So if I point the webviewer to www.draw.io (or https://app.diagrams.net/), I still get an unresponsive website. Link to post Share on other sites
comment 1,779 Posted June 7, 2020 Share Posted June 7, 2020 2 hours ago, sal88 said: if I point the webviewer to www.draw.io (or https://app.diagrams.net/), I still get an unresponsive website. I cannot reproduce your problem. I set my web viewer to "https://app.diagrams.net" and it seems to function just fine. Perhaps it's a Windows issue (I am on a Mac)? Link to post Share on other sites
sal88 2 Posted June 8, 2020 Author Share Posted June 8, 2020 Hey comment It also works on our (only) mac but none of our Windows PCs Thanks Link to post Share on other sites
Wim Decorte 514 Posted June 8, 2020 Share Posted June 8, 2020 That would be because there is something in their implementation that is not compatible with IE <whatever version of IE that FM on Windows now uses for the web viewer> Remember that the web viewer is not a full-featured browser. Link to post Share on other sites
sal88 2 Posted June 8, 2020 Author Share Posted June 8, 2020 (edited) Is there a way to isolate which element is causing the issue (I'm not sure what I'd do with that information tbh). I'm experiencing limited functionality from a search feature I'm trying to implement also (attached). The Javascript developers i've approached have been reluctant to help as they are not familiar with FileMaker. If I could tell them exactly which browser it uses then that would help. I've implemented this script: https://codepen.io/gapcode/pen/vEJNZN Which tells me the FileMaker browser is IE 11. This make sense as my search script does not work if I load it in IE 11. However https://app.diagrams.net/ does work in IE 11. To be exact though, my IE11 browser returns: "Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; .NET4.0C; .NET4.0E; .NET CLR 2.0.50727; .NET CLR 3.0.30729; .NET CLR 3.5.30729; Zoom 3.6.0; rv:11.0) like Gecko" and FM Web viewer returns: "Mozilla/5.0 (Windows NT 6.2; Win64; x64; Trident/7.0; rv:11.0) like Gecko" So it's possible FM Webviewer is a slightly different version of IE 11? search.htm Edited June 8, 2020 by sal88 Link to post Share on other sites
Wim Decorte 514 Posted June 8, 2020 Share Posted June 8, 2020 17 minutes ago, sal88 said: So it's possible FM Webviewer is a slightly different version of IE 11? Not a different version, but a different implementation of the IE11 engine. That's what I meant with the my statement that the web viewer is not a full browser. Link to post Share on other sites
sal88 2 Posted June 13, 2020 Author Share Posted June 13, 2020 My javascript developer managed to get the search feature working in IE11...and it works in FM too. I guess I'll have to wait for the anticipated updates to the web viewer (as per recent JS functions discussion on thecontextpodcast.com) for draw.io. Link to post Share on other sites
sal88 2 Posted July 2, 2020 Author Share Posted July 2, 2020 I've just discovered that the webviewer in webdirect appears to have full (or at least more) javascript functionality . Link to post Share on other sites
comment 1,779 Posted July 2, 2020 Share Posted July 2, 2020 10 minutes ago, sal88 said: the webviewer in webdirect appears to have full (or at least more) javascript functionality There is no "web viewer" as such in WebDirect. The web viewer code is executed in an iframe - so naturally the functionality is dictated by the user's browser. Link to post Share on other sites
sal88 2 Posted July 2, 2020 Author Share Posted July 2, 2020 I see. As far as I can tell the Perform JavaScript in Web Viewer and FileMaker.PerformScript still work as they would in FM Pro. Is that correct? Thanks Link to post Share on other sites
comment 1,779 Posted July 2, 2020 Share Posted July 2, 2020 I am still in v.18. According to the help for the Perform JavaScript in Web Viewer[] script step: Quote In FileMaker WebDirect: •This script step works only if the web viewer’s webpage has the same origin as the FileMaker WebDirect webpage. See Scripting with JavaScript in web viewers. •The user can’t click a web viewer to give it the focus. Therefore, you must specify the Object Name option or use the Go to Object script step first; otherwise, this script step will return an error. And here you will find similar constraints for the opposite direction: Quote •Because FileMaker WebDirect is subject to a same-origin policy in web browsers for security, JavaScript in a web viewer and FileMaker scripts can call each other only if the web viewer’s webpage has the same origin as the FileMaker WebDirect webpage. (A webpage’s origin is its URL scheme, host name, and port.) •In FileMaker WebDirect, the HTML specified for the web viewer must begin with "data:text/html," as shown in the example above. Otherwise, the call to the FileMaker.PerformScript() function fails. 1 Link to post Share on other sites
sal88 2 Posted July 2, 2020 Author Share Posted July 2, 2020 That is very interesting. Thank you comment. Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now