0

I have developed an extension for Internet Explorer in C# using Visual Studio .Net 4.5.2 Framework which I would like to port to Chrome & Edge (Chromium). It is quite a sophisticated extension that comprises 6 bespoke C# libraries I have developed which in turn use a number of system libraries including Microsoft.mshtml & System.Windows.Forms. I am hoping that building out as a WebAssembly will prove a viable solution.

I tried porting to .Net 5.0 using Visual Studio 2019 with Windows.Wasm and also using Mono.Wasm but these have simply thrown up a succession of compatibility challenges.

Can anyone recommend alternative approaches I should look at. I am considering trying Blazor (although this appears to be more orientated towards server-side than client-side), Ooui.Wasm and Uno platform.

Regards, Howard

  • `which in turn use a number of system libraries including Microsoft.mshtml & System.Windows.Forms.` none of these things is going to work as a browser extension. How is WinForms going to work on Mac or Linux? And why would any browser extension need to host its *own* browser, much less IE? I suspect what you built only works because a *lot* of browser security features are explicitly disabled – Panagiotis Kanavos Jan 10 '21 at 12:29
  • 1
    As for can you use Wasm to build extensions? Yes, [there's a similar question already](https://stackoverflow.com/questions/49611290/using-webassembly-in-chrome-extension). Can you use it to run IE inside Chrome? No. – Panagiotis Kanavos Jan 10 '21 at 12:33
  • Hi Panagiotis - I am not trying to run IE inside Chrome, I am trying to port a number of libraries that I developed when writing the IE extension to build a webassembly that can be used in conjunction with a Chrome extension. My IE extension did not require me to explicitly disable any IE browser security features. I use Winforms to allow a user to enter a licence key I supply and also for entering 'words' which are used by the extension for matching in the current page. I am considering pulling this functionality out into Javascript. – Howard Ricketts Jan 12 '21 at 17:49

1 Answers1

0

Blazor has two different types of projects, one is Blazor Server App, which is obviously server side, and another one is Blazor WebAssembly App, which can be used to develop client side browser extension. I too, has the intention to create browser extension using Blazor and so I created a package to help others achieve the same too. Feel free to checkout my repo on GitHub on how to do it. This package includes the ability to interact with the WebExtensions API for cross browser compatibility. A browser APi polyfill developed by Mozilla is also loaded so that you can use WebExtensions API in Chrome too.

However in your scenario, with Blazor it is not possible to use WinForms so you will have to convert them to Razor components.

mylee
  • 1,293
  • 1
  • 9
  • 14
  • Thank you for taking the time to reply. Instead of using WinForms I have decided to use Javascript. As I dont need any of the other UI features I think I will probably use Mono rather than Blazor but I definitely take a look at your project in GitHub. – Howard Ricketts Mar 23 '21 at 16:51
  • That is cool, if you have already got a POC project that can be compiled and loaded as a chrome extension are you able to share with me? I have a separate package [WebExtension.Net](https://github.com/mingyaulee/WebExtension.Net) which I hope a mono project would be able to consume too. Anyways, when you said you use WinForms I assumed you have UI that just C# and JavaScript would not be enough, so Blazor would be a better fit because it supports Razor. – mylee Mar 24 '21 at 01:10