Tampermonkey: Resource import doesn't expose variable

Created on 24 Aug 2017  路  1Comment  路  Source: Tampermonkey/tampermonkey

I'm using the script hosted here:

https://github.com/GetintheLoop/asana-highlighter/blob/e540661f26b7e333e614ce9c522768a93332c3d6/scripts/asana-highlight.js

When I try to increase the version of highlight.js above 8.3, the script breaks because hljs is no longer exposed.

Compare

https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/highlight.min.js
https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.4/highlight.min.js

I tried to fix this by:

  • Using the script tag to import hightlight.js. Unfortunately asana prevents cross domain imports.
  • using @resource and eval - however hljs is still not exposed for some reason

Is there another way to fix this? Worst case is to write a custom js file... but ideally I don't have to do that.

bug fixed at beta

Most helpful comment

Fixed at TM beta 4.4.5549. Thanks for your bug report.

>All comments

Fixed at TM beta 4.4.5549. Thanks for your bug report.

Was this page helpful?
0 / 5 - 0 ratings