I'm the creator of JANITOR – Java API Navigation Is The Only Rescue, a userscript which:
Inserts a navigation tree for modules, packages and types (interfaces, classes, enums, exceptions, errors, annotations) into the Javadoc pages of Java 11+.
Due to changes in the DOM in Java 17+ from kind-of-type sections to a single table containing all types in alphabetic order I have to use synchronous XMLHttpRequest
s to get the kind (I, C, En, Ex, Er, A) of a type for the tree view.
I experienced that this can take a while to refresh the tree view (5-10 seconds) with packages with many types (e.g. java.io
, java.lang
) and I get:
⚠️ Synchronous XMLHttpRequest on the main thread is deprecated ...
... and in Synchronous XMLHttpRequest deprecated is mentioned:
[...] that my browser (Chromium) automatically updated to a new version that doesn't allow synchronous AJAX-requests anymore.
I experimented with a worker in the past but at reactivating it I get:
❗ Security Error: Content at https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/Deprecated.html may not load data from https://gitlab.com/gerib/userscripts/-/raw/master/janitor/janitor-navigation-loader.js.
I guess this is to prevent XSS.
Is there a way to supply the worker with code other than with a file (e.g. String, template literal, Array, List, ... whatever) or am I out of luck now?