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
JSDom supports a custom resource loader, e.g:
class CustomResourceLoader extends jsdom.ResourceLoader { fetch(url, options) { console.log(`Loading ${url}...`); return super.fetch(url, options); } } const dom = new JSDOM(``, { resources: new CustomResourceLoader() });
However, window (and browser-env) doesn't allow this because it overrides the resources field:
window
browser-env
resources
window/src/index.js
Lines 8 to 12 in 82c7830
Any chance this could be changed so that a custom loader is allowed?
The text was updated successfully, but these errors were encountered:
Sure, I'd happily accept a PR for this as long as it doesn't break existing behaviour.
Sorry, something went wrong.
Sure, #37 does this.
It feels a bit clunky, I think the best option would be to just forward the whole jsdomConfig, i.e.
module.exports = class Window { constructor(jsdomConfig = {}) { return (new JSDOM('', jsdomConfig)).window; } };
But I'm assuming there's some context I'm missing and also this would break backwards compatibility.
Successfully merging a pull request may close this issue.
JSDom supports a custom resource loader, e.g:
However,
window
(andbrowser-env
) doesn't allow this because it overrides theresources
field:window/src/index.js
Lines 8 to 12 in 82c7830
Any chance this could be changed so that a custom loader is allowed?
The text was updated successfully, but these errors were encountered: