Open ghost opened 13 years ago
Oh fun! I wasn't aware of @tmpvar adding those. I'll integrate those, unless you have ideas as to how it should work!
Given the above use case, the jsdom.jQueryify function should (1) provide an options parameter or (2) honor jsdom.jsdom options and/or global options. Doesn't that sound about right?
\ Options to include features.
Yes!
This not an issue for your project. I just wanted to pass along a comment I just posted on the jsdom github site: ... I reported on this issue, see #290. Inspired by this post (#328), I also tried the html5 parser. Code snippet:
This pattern can be found on the htlm5 github site. While I was able to pass in 'features' options (as detailed above), the jsdom.jQueryify function appears to overwrite the feature's settings. See jsdom.js (lines 122-4):
122 window.document.implementation.addFeature('FetchExternalResources', ['script']); 123 window.document.implementation.addFeature('ProcessExternalResources', ['script']); 124 window.document.implementation.addFeature('MutationEvents', ["1.0"]);
Naturally, I wanted to set these to false to avoid script processing. My only option was to edited the code, setting all 3 features to false. It would be nice if the global defaultDocumentFeatures function worked as expected or the jQueryify function signature provided for options/features. ...
So using the html5 parser allows me to circumvent the jsdom 'hierarchy request' error. But the integration between html5 and jsdom does not allow me to disable target features. Unless, I'm missing something.