I would like to build a hybrid app which targets a single website. The app would allow for the automation of certain tasks by injecting java script into the webpage. I do not have any influence over the development of the webpage.
In the automation steps I need to upload a file (eg Word docx, Outlook msg or PDF) to the webpage. In my Chrome extension, for example I turn the file into base64 and send it as a string (in parts) to the page. On the page I have some java script that converts the Base64 to a blob. Such a method would not be my first choice for WebView2, however can PostWebMessageAsString handle a Base64 string with a few MB in size? What would be the MAX size it could handle?
How else can I get a file from the local system into the webpage? Is there a way to even use local file system paths? Or is there a possibility (I believe CEFSharp has this) to set up a custom Schema ( SchemeHandler) to add resources?
Also I would like to add a JS file to the webpage containing a lot of the functions I later intend to call. This maybe a similar question to the one I have above, but how can I upload this file? Or could I add a reference to a JS file with a local file system path in the SCRIPT tag?