AngleSharp / AngleSharp.Js

:angel: Extends AngleSharp with a .NET-based JavaScript engine.
https://anglesharp.github.io
MIT License
103 stars 22 forks source link

Need to be able turn off JsNavigationHandler #71

Open vladomelchenko opened 4 years ago

vladomelchenko commented 4 years ago

I need to use angle sharp with js engine without loading scripts on html pages, only for execute my scripts. Now in JsConfigurationExtensions i cant remove JsNavigationHandler from configuration, but i need this ability

FlorianRappl commented 4 years ago

Well, the NavigationHandler only handles javascript: URLs. It does not run the scripts.

You can disable the navigation handler even today:

var config = Configuration.Default.WithJs().Without<JsNavigationHandler>();

If all scripts on a given website are external, then just disabling resource loading would help (its by default disabled anyway).

I'm not sure if its sufficient for your use case though.