Rank: Newbie Groups: Member
Joined: 11/30/2014 Posts: 6
|
Is there a way to get related javacripts , css files content after an HTML page was loaded?
We can get the related file names through the BeforeRequestLoad event but we want their content.
we checked the WebView_AfterReceiveHeaders which was the closed way we found to get files data but the response.outputstream is not available.
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi,
You won't be able to get that directly through any EO.WebBrowser interface. The file contents goes from the network layer straight to parser (for performance reason), it does not pass intermediate layers.
One way you can do it is to get the Url of the file (for example, by examining the script element's src property with JavaScript), then uses a XmlHttpRequest object to fetch the file contents yourself. You will need to write some JavaScript code to perform this task, then call WebView.EvalScript to run the script inside the WebView.
Thanks!
|
Rank: Newbie Groups: Member
Joined: 11/30/2014 Posts: 6
|
I think we can use the BeforeRequestLoad , get the URLs and then load the files with our code.
Is this event raised when a file is downloaded when javascript code asks for it. For example a javascript method which uses ajax get of a file?
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Hi, You should not use BeforeRequestLoad for that purpose. You can use a custom resource handler for that purpose. The custom resource handler will capture everything you want to capture and allow you to override any contents you wish. See here for more details on how to use this feature: http://www.essentialobjects.com/doc/6/advanced/resource_handler.aspxThanks!
|