On Fri Nov 11 10:13:58 2022 +0000, Jacek Caban wrote:
`IPersistMoniker_Load` probably gives valid results in this case, but it's less similar to real-world use, so I think it would be interesting to try find out what's wrong with using `put_href`. One thing I can think of is to report MIME type from our pluggable protocol handler, does reporting `BINDSTATUS_MIMETYPEAVAILABLE` (or even `BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE`) help? And yes, it sounds like native indeed breaks COM rules.
Unfortunately those don't help. The Protocol handler is not called at all after the navigation is issued (tracing all the methods). Even reporting the mime type on the old page didn't change a thing.
It's also useful to note that this happens on all navigations, not just `put_href`. `replace` for example, but also `window.navigate` or `window.open` (with _self obviously). However, I looked at why `navigation.js` works, since it navigates, but it turns out this is only an issue on top-level windows. iframes work fine and do use the protocol handler (I changed the URL from `about:blank` to something with http for the handler, traced and it gets called…).
I don't know if this is deliberate or a bug in Windows' urlmon. But it seems it ignores temporary pluggable namespace handlers when doing any sort of navigation on the top level window. But only the top-level.
I resorted to keep the `IPersistMoniker_Load` way, but I had to add `IHlinkTarget_Navigate`, otherwise unload events wouldn't be dispatched (this is for next MR, not tested here).