Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark WebBrowser and all related (e.g., HTML* types) as obsolete #6964

Open
RussKie opened this issue Apr 5, 2022 · 16 comments
Open

Mark WebBrowser and all related (e.g., HTML* types) as obsolete #6964

RussKie opened this issue Apr 5, 2022 · 16 comments
Labels
api-approved (4) API was approved in API review, it can be implemented area: Analyzers and Fixers
Milestone

Comments

@RussKie
Copy link
Member

RussKie commented Apr 5, 2022

Is your feature request related to a problem? Please describe

The WebBrowser control is based on IE Trident engine, which is almost universally unusable for general web browsing these days. It is also based on COM/ActiveX, which poses difficulties in trimming/native AOT scenarios.
Also, Internet Explorer 11 has been retired and is officially out of support as of 15 June 2022. Whilst the underlying Trident engine (mshtml.dll) isn't being removed (yet?) from Windows, the general guidance is to use the modern replacement, which is WebView2 web browser control.

Describe the solution you'd like and alternatives you've considered

For .NET 7 and .NET 8 decorate all web- and html-related types as obsolete (error: false) with a link to directing developers use WebView2 control instead.

The obsoletion process entails the following:

The obsoletion will also happen in several stages:

  • .NET 7/8 release - build warnings/documentation only
  • (likely) subsequent release - build errors / implementation removal
  • (possibly) subsequent future release - complete removal of API.

Will this feature affect UI controls?

The affected controls will need to be made hidden from the designer.

@RussKie RussKie added api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation untriaged The team needs to look at this issue in the next triage labels Apr 5, 2022
@dreddy-work
Copy link
Member

Team agrees principally.

@dreddy-work dreddy-work removed the untriaged The team needs to look at this issue in the next triage label Apr 7, 2022
@dreddy-work dreddy-work added this to the .NET 7.0 milestone Apr 7, 2022
@dreddy-work dreddy-work added api-needs-work (3) API needs work before it is approved, it is NOT ready for implementation; applied by repo owners api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation and removed api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation labels Apr 7, 2022
@dotMorten
Copy link
Contributor

Better idea: Replace just the internal implementation with the new browser control.

@RussKie
Copy link
Member Author

RussKie commented May 23, 2022

I don't think this is feasible - the API surface is different, the types are different, the deployment model is different... It sounds similar to "I want to continue building VB6 apps, just plug the .NET runtime under the covers".

@kant2002
Copy link
Contributor

Bye bye IE. let mark classes as obsolete. What are internal position? Does any discussion should happen for this plan?

@RussKie
Copy link
Member Author

RussKie commented Jun 17, 2022

Does any discussion should happen for this plan?

The team has discussed this proposal and reached an agreement that this proposal is worth pursuing further. However, the team doesn't currently have any cycles to work on this further. If you're keen, you're welcome to start working on this.

The obsoletion process entails the following:

The obsoletion will also happen in several stages:

  • current release - build warnings/documentation only
  • (likely) next release - build errors / implementation removal
  • subsequent future release - complete removal of API.

@RussKie RussKie added api-approved (4) API was approved in API review, it can be implemented and removed api-needs-work (3) API needs work before it is approved, it is NOT ready for implementation; applied by repo owners labels Jun 17, 2022
@kant2002

This comment was marked as resolved.

@RussKie

This comment was marked as resolved.

@Svetoslav92
Copy link

Don't hurry up with that. Windows 8.1 is with extended support until January 10, 2023 and as we all know it it has IE11, Trident. Trident itself is fully working and functional in Windows 10,11 and not marked as obsolete. It makes sense to obsolete it here when Microsoft plans removing Trident ? I think this won't happen anytime soon as this will end HTA,Vbscript,Jscript and everything related. That means end of job of many system administrators and WW3

@merriemcgaw merriemcgaw modified the milestones: .NET 7.0, .NET 8.0 Aug 10, 2022
RussKie added a commit to RussKie/winforms that referenced this issue Aug 12, 2022
The WebBrowser control is based on IE Trident engine, which is almost
universally unusable for general web browsing these days. It is also
based on COM/ActiveX, which poses difficulties in trimming/native AOT
scenarios.

Also, Internet Explorer 11 has been retired and is officially out of
support as of 15 June 2022. Whilst the underlying Trident engine (mshtml.dll)
isn't being removed (yet?) from Windows, the general guidance is to use
the modern replacement, which is WebView2 web browser control.

Resolves dotnet#6964
@ghost ghost added the 🚧 work in progress Work that is current in progress label Aug 12, 2022
@ghost ghost removed the 🚧 work in progress Work that is current in progress label Jan 27, 2023
@JeremyKuhne JeremyKuhne modified the milestones: .NET 8.0, .NET 9.0 Aug 16, 2023
@fffelix-jan
Copy link

I strongly oppose the removal of the WebBrowser control. I think it should be replaced by its new Chromium equivalent. Since backwards compatibility would be broken anyways by removing it, you might as well keep the intuitive class name but replace it with something newer, and try to reimplement most of the methods in the Chromium engine, with the exact same method names to provide developers with a familiar interface. If I am not mistaken, the WinForms implementation in Mono is reimplemented in Gecko, so it wouldn't hurt to reimplement it in Chromium, just like Edge.

@paul1956
Copy link
Contributor

WebView2 could be used as a replacement, but it needs a wrapper to add key back missing functionality. The biggest missing feature is the ability to view the document source which is trivial in WebBrowser.

@fffelix-jan
Copy link

I hope this ability can be added!

@hota99
Copy link

hota99 commented Nov 29, 2023

Webview2 uses many resources on a multi users environment (Such as UDF). We decided to keep good old webbrowser.

@JeremyKuhne JeremyKuhne removed the api-suggestion (1) Early API idea and discussion, it is NOT ready for implementation label Jan 24, 2024
@merriemcgaw merriemcgaw modified the milestones: .NET 9.0, Future Jan 24, 2024
@JeremyKuhne
Copy link
Member

Note that we will never remove API from the surface area. We also won't remove the ability to use this. When Windows removes Trident (likely never) then this won't work.

@paul1956
Copy link
Contributor

paul1956 commented Jan 24, 2024

@JeremyKuhne

Note that we will never remove API from the surface area. We also won't remove the ability to use this. When Windows removes Trident (likely never) then this won't work.

What does "Note that we will never remove API from the surface area. We also won't remove the ability to use this." mean in reality?

  1. The API will always exist but at some time in the future (if Windows removes Trident) it will not do anything, so why keep it?
  2. Sometime in the future (just before Windows removes Trident) you will reimplement the broken parts and it will work transparently.
  3. Something else.

If the second is true, why mark it as obsolete. If 3 that?

@JeremyKuhne
Copy link
Member

@paul1956 we'll never remove surface area as that is a binary breaking change. Implementations may change or get removed, but I really doubt that will happen in the foreseeable future. I doubt we would ever reimplement this API over anything else as the cost would be quite high.

I don't make the decisions ultimately, but I know it would take an awful lot for Windows to remove Trident all together as it would be such a major impact. They still ship the VB6 runtime after all. :)

Ultimately, we'll probably do things to encourage you to move off of this, but we have no plans to make this functionality completely inaccessible.

@paul1956
Copy link
Contributor

@paul1956 we'll never remove surface area as that is a binary breaking change. Implementations may change or get removed, but I really doubt that will happen in the foreseeable future. I doubt we would ever reimplement this API over anything else as the cost would be quite high.

I don't make the decisions ultimately, but I know it would take an awful lot for Windows to remove Trident all together as it would be such a major impact. They still ship the VB6 runtime after all. :)

Ultimately, we'll probably do things to encourage you to move off of this, but we have no plans to make this functionality completely inaccessible.

The app stopped using it a long time ago, but lost some functionality because it was difficult to implement with WebView2 (when it was done), if WebBrowser was to be continued to be support, I might consider going back. But at the same time WebView2 is getting more functionality so it might not necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-approved (4) API was approved in API review, it can be implemented area: Analyzers and Fixers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants