How to add Request Header for All Outgoing Request in WKWebview

Hi,

I want to ask, how to add Request Header for All Request (specially ajax and sub link request) in WKWebview? because I need to add "Authorization" in Header to access the Web page.

In UIWebview I can use Custom NSURLProtocol to handle it, but in WKWebview i cannot found how to do it.

What have i tried?
1. I already tried to set "Authorization" in setValue URLRequest (https://developer.apple.com/documentation/foundation/urlrequest/2011447-setvalue), but It only accept for 1 URL not all URL Request

2. In function "decidePolicyFor navigationAction" (https://developer.apple.com/documentation/webkit/wknavigationdelegate/1455641-webview?language=objc) add "Authorization" in each outoging requests, but some javascript doesn't load, and cannot passing value for HTTP Method POST

@"mnathanael" Did you find any solution for the above problem? I am facing this issue and can't able to find any solution for this.

How to add Request Header for All Outgoing Request in WKWebview
 
 
Q