Jump to content
Server Maintenance This Week. ×

draw.io javascript not fully functional


sal88

This topic is 1392 days old. Please don't post here. Open a new topic instead.

Recommended Posts

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 comment
Share on other sites

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 comment
Share on other sites

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 by sal88
Link to comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

  • 3 weeks later...

I've just discovered that the webviewer in webdirect appears to have full (or at least more) javascript functionality :).

Link to comment
Share on other sites

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 comment
Share on other sites

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 comment
Share on other sites

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.

 

 

 

  • Thanks 1
Link to comment
Share on other sites

This topic is 1392 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.