MFC: MIME type "text / css" not recognized IInternetProtocolSink

I have a webbrowser control with a plug-in protocol based on the IInternetProtocol interface. When loading HTML sites, everything is fine. But when loading an external CSS stylesheet, the MIME type "text / css" reported by BINDSTATUS_MIMETYPEAVAILABLE and BINDSTATUS_VERIFIEDMIMETYPEAVAILABLE is ignored.

  • If I set FEATURE_BROWSER_EMULATION in the registry to 8888 (IE8), the external CSS will display correctly (in the "Registry" folder)
  • If I set FEATURE_BROWSER_EMULATION to the registry 11001 (IE11) or anything other than compatibility modes with IE 8, external CSS is ignored (in the "Registry" folder)
  • If the HTML site contains the IE = edge meta tag, external CSS is ignored, as this causes the web browser control to run in IE11 mode.
  • If I disable the plug-in protocol, external CSS will be displayed regardless of the value set for FEATURE_BROWSER_EMULATION
  • if I disconnect the plug-in protocol and deliver the CSS stylesheet with the wrong MIME type mismatch from the demo server (in the Server folder), the plug-in protocol behavior can be reproduced both in IE and in the web browser control
  • passing headers to the IHttpNegotiate interface does not affect
  • any other controls installed with CoInternetSetFeatureEnabled have no effect

My findings so far :

  • IE8 - IE8 MIME MIME sniffing
  • IE9 , MIME
  • webbrowser IE9 + MIME "text/css", MIME, CSS.

:

  • - ? , ?
  • CSS IInternetProtocolSink?

, :
https://github.com/elsamuko/SimpleBrowser

:
http://imgur.com/a/w3oCv

:
http://msdn.microsoft.com/en-us/library/aa752046%28v=vs.85%29.aspx
http://www.codeproject.com/Articles/157329/Http-Monitor-for-Webbrowser-Control
http://www.codeproject.com/Articles/12865/An-Asynchronous-Pluggable-Protocol-Handler-for-dat

+4
1

, # , .

BINDSTATUS_CACHEFILENAMEAVAILABLE . , , . #, , .

BINDSTATUS_MIMETYPEAVAILABLE, . .

, ...

sink.ReportProgress(UrlMon.BINDSTATUS.BINDSTATUS_MIMETYPEAVAILABLE, mimetype);
sink.ReportProgress(UrlMon.BINDSTATUS.BINDSTATUS_CACHEFILENAMEAVAILABLE, localfilename);
sink.ReportData(UrlMon.BSCF.BSCF_DATAFULLYAVAILABLE, 0, 0);
sink.ReportResult(0, 200, null);

:

, async. . . - BINDF.BINDF_NEEDFILE ( IInternetBindInfo:: GetBindInfo). .

. - ( Microsoft) Internet Explorer css , BINDF_NEEDFILE. BINDF_NEEDFILE, .

+3

Source: https://habr.com/ru/post/1525219/


All Articles