Setting javaScriptCanAccessClipboard breaks app for MacOS Sierra

I'm using WKWebView to display a local web app within a C application. To allow access to the clipboard without a gesture I set javaScriptCanAccessClipboard & DOMPasteAllowed in WKWebViewConfiguration preferences to true.
This works fine on MacOS Catalina, however I get the following error when trying to run my application on MacOS Sierra:

Code Block text
Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKPreferences 0x39819390> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key javaScriptCanAccessClipboard.'


Not sure what I need to do to support older versions of MacOS...
Any help would be greatly appreciated!

Here's the code in question by the way: https://github.com/webview/webview/blob/479f58cfa815722155339527ecef997cf12a8a37/webview.h#L630-L637
Setting javaScriptCanAccessClipboard breaks app for MacOS Sierra
 
 
Q