I am adding dynamically 2 style sheets in a WKWebView
having local content loaded using loadFileURL
.
The cocoa application calls the following javascript snippet to add the stylesheets.
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.type = 'text/css';
link.title = csstype;
link.href = cssSheetPath1;
document.head.appendChild(link);
var link = document.createElement('link');
link.setAttribute('rel', 'stylesheet');
link.type = 'text/css';
link.title = csstype;
link.href = cssSheetPath2;
document.head.appendChild(link);
The 2 stylesheets are located in the same directory. I can either load the first one or the second one, but never both. If I try to load both, only the first one is applied.
Any idea from where the issue can come from?