You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! So I might have some basic misunderstandings of this framework--but I'm trying to create a Blazor web extension that changes the rendering of a content script based on an option added to the user's right-click context menu. So if the user right clicks a portion of text on a web page and presses the web extension option, they'll receive a read-out from the content script based on the selected text.
I was able to add a right-click option by interfacing with the web extension API in my extension's popup page (Popup.razor)--but that only seems to execute once the popup has been opened. So I tried adding the same code to my content script (ContentScript.razor) to reliably add the right-click option and hook it to the content script--but it appears as though content scripts can't access the full web extension/browser API.
I'm not sure how to accomplish this. Is there a simple way to access the full web extension API using a C# script running reliably in the background? I just want to control menu options/tabs/etc. using a background script in C#, ideally not so different from what's possible in Javascript using BackgroundWorker.js.
The text was updated successfully, but these errors were encountered:
Hi, from what I understood of your use case, the user would first select some text, then right click to view the context menu, select an action added to the context menu by the extension, and the selected text will be read out.
One possible solution would be to have a background worker listening to messages from the content script. But this means that you have to write it in JS. It's not possible to add listeners using Blazor because all listeners have to be registered synchronously.
With manifest V3 there is no persistent background (although there is a proposal) so the most optimum way would be to write it in JS for now.
Hey! So I might have some basic misunderstandings of this framework--but I'm trying to create a Blazor web extension that changes the rendering of a content script based on an option added to the user's right-click context menu. So if the user right clicks a portion of text on a web page and presses the web extension option, they'll receive a read-out from the content script based on the selected text.
I was able to add a right-click option by interfacing with the web extension API in my extension's popup page (Popup.razor)--but that only seems to execute once the popup has been opened. So I tried adding the same code to my content script (ContentScript.razor) to reliably add the right-click option and hook it to the content script--but it appears as though content scripts can't access the full web extension/browser API.
I'm not sure how to accomplish this. Is there a simple way to access the full web extension API using a C# script running reliably in the background? I just want to control menu options/tabs/etc. using a background script in C#, ideally not so different from what's possible in Javascript using BackgroundWorker.js.
The text was updated successfully, but these errors were encountered: