I have a small CSS file I use with JavaScript to override the CSS on a website loaded in a WebView. I would like to load it locally instead of need to access it online. I have gotten the JavaScript to work perfectly when the file is uploaded to a temporary filehost, so it works fine, but something regarding permissions won't let me use it as an asset.
I've tried setting permissions, changing the WebView's settings to allow MixedContentMode always, tried using LoadData, etc, but it always throws the "Not allowed" issue. The asset has the AndroidAsset build action.
string jsToInject = "javascript: var link=document.createElement('link');link.href='file:///android_asset/newsOverride.css';link.type ='text/css'; link.rel ='stylesheet';document.getElementsByTagName('head')[0].appendChild(link);";
view.LoadUrl(jsToInject);
When the link.href field is set to the file hosted on the web somewhere, it loads the CSS as expected. But when it's selected as an asset it simply throws
I/chromium(11626): [INFO:CONSOLE(1)] "Not allowed to load local resource: file:///android_asset/newsOverride.css", source: (1)
All I've been able to find on the error is with Xamarin Forms, not Xamarin Android, any help is appreciated.