Maptool: Allow JavaScript / CSS to be fetched from several large CDN

Created on 29 Apr 2020  ·  9Comments  ·  Source: RPTools/maptool

Modify the webview so that it can fetch javascript and CSS from several large CDNs as this will allow people to use common libraries that are not likely to disappear and render a framework unuseable as a self hosted script might.

We can investigate caching these locally or within the campaign file in the future if need be to even further mitigate the chances of not being able to find a required script or needing to run offline.

claimed feature tested

Most helpful comment

Sorry for the delay, hadn't actually _tested_ anything... lazily documented without that.

image

Works, I'd say its tested and approved!

All 9 comments

@Merudo This is yours to test.

White lists the following CDNs

  • JQuery CDN (https://code.jquery.com)
  • JSDelivr CDN (https://cdn.jsdelivr.net)
  • Bootstrap CDN (https://stackpath.bootstrapcdn.com)
  • unpkg CDN (https://unpkg.com)
  • CloudFlare JS CDN (https://cdnjs.cloudflare.com)
  • Google CDN (https://ajax.googleapis.com)

Also white lists google fonts

Pinging @melek

Okay, I've added a page about these CDN with some bare-bones examples. I've put it in the Cookbook and as an advanced tutorial. I've left it as a stub for now.

I've linked it from the frame5 & dialog5 articles, a new overlay roll option article,and the Supported CSS Styles article in a note that tops the page linking folks to the new frame5/dialog5/overlay/CDN features.

@melek Can I consider this tested and approved?

Sorry for the delay, hadn't actually _tested_ anything... lazily documented without that.

image

Works, I'd say its tested and approved!

Linking one of the small test campaigns I used, it has google fonts and animation library. Sadly the animation leaves a little to be desired performance wise.
animtest.cmpgn.zip

That's great. Thanks!

I think there might be a way to cache animations? Not sure how that would work.

Was this page helpful?
0 / 5 - 0 ratings