We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
We recently had an issue at InStep where a CDN was not working properly, and we were only getting half of a JS file.
It would be great to have an API that can import a JS module while also checking the integrity.
This works:
const request = new Request("https://cdn.bootcdn.net/ajax/libs/echarts/5.5.0/echarts.min.js", { integrity: "sha256-QvgynZibb2U53SsVu98NggJXYqwRL7tg3FeyfXvPOUY=", }); const response = await fetch(request);
This throws an exception:
const request = new Request("https://cdn.bootcdn.net/ajax/libs/echarts/5.5.0/echarts.min.js", { integrity: "sha256-foobar", }); const response = await fetch(request);
Something like the following would be great:
IJSObjectReference module = await JS.ImportModuleAsync( src: "https://cdn.bootcdn.net/ajax/libs/echarts/5.5.0/echarts.min.js", integrity: "sha256-QvgynZibb2U53SsVu98NggJXYqwRL7tg3FeyfXvPOUY="); IJSObjectReference module = await JS.ImportModuleAsync( src: "https://cdn.bootcdn.net/ajax/libs/echarts/5.5.0/echarts.min.js", integrity: "sha256-QvgynZibb2U53SsVu98NggJXYqwRL7tg3FeyfXvPOUY=", fallback: "./_content/MyPackage/echarts.min.js");
The second option here first checks the CDN, and falls back the local version if there are any issues loading the script from the CDN.
The text was updated successfully, but these errors were encountered:
@caroHagg did this and it's merged now
Sorry, something went wrong.
No branches or pull requests
We recently had an issue at InStep where a CDN was not working properly, and we were only getting half of a JS file.
It would be great to have an API that can import a JS module while also checking the integrity.
This works:
This throws an exception:
Something like the following would be great:
The second option here first checks the CDN, and falls back the local version if there are any issues loading the script from the CDN.
The text was updated successfully, but these errors were encountered: