|
Rank: Newbie Groups: Member
Joined: 5/2/2017 Posts: 3
|
Hi, I'm new to EO.WebBrowser and try to catch html-tags <link> and <script>. I expected to receive the request with common http-scheme. But this doesn't work.
When I add a custom scheme like "mylink", I am able to catch a link like "<link href='mylink://styles/my.css' rel='stylesheet' type='text/css'>".
But this doesn't work with a script like "<script src='myscript://jquery-1.11.2.min.js' type='text/javascript'></script>" (I have registered scheme "myscript" too)
How can I catch "script" requests?
Thx!
|
|
Rank: Newbie Groups: Member
Joined: 5/2/2017 Posts: 3
|
Hi,
here I'm again.
As I have seen just now I had add typing error: "myscript://" scheme is working too.
But how can I detect a link like "<link href='styles/my.css' rel='stylesheet' type='text/css'>" without adding a custom scheme?
Thx!
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
You must register your custom schemes that are not known to the browser engine in order to catch it with your custom resource handler. You do not have to register for the standard protocols because the browser engine already registered them for you.
Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 5/2/2017 Posts: 3
|
Hi,
yes I know how to use custom schemes.
But I expect that a link like "<link href='styles/my.css' rel='stylesheet' type='text/css'>" is catched by Standard protocol http automatically. But it doesn't. Note: style is a subfolder of my href and not a scheme
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi,
Here are the rules:
1. The scheme of your style will be the same as the scheme of your main page unless explicitly specified. So for example, if your main page is test://page1.html, then the scheme of your style is "test" as well unless you override it explicitly (for example, href="test2://styles.my.css"). In that case you will need to call RegisterCustomSchemes to register the "test" protocol. You do not have to do this step for standard protocols;
2. You always need to call RegisterResourceHandler to register your own custom resource handler if you want to handle the request yourself, regardless standard protocol or not;
Hope this clears it up.
Thanks
|
|