Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable text selection in wkwebview #272

Merged

Conversation

IniZio
Copy link
Contributor

@IniZio IniZio commented Mar 8, 2024

"document.documentElement.style.userSelect = 'none';";
WKUserScript *userScript = [[WKUserScript alloc] initWithSource:disableUserSelectScript injectionTime:WKUserScriptInjectionTimeAtDocumentEnd forMainFrameOnly:NO];
[controller addUserScript:userScript];
configuration.userContentController = controller;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose configuration.userContentController is nil, so you need to create a WKUserContentController yourselves? If this is the case, you should leave a comment to document this behavior difference between Objective-C and Swift.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested, and it is absolutely fine to just use configuration.userContentController. I added a commit to correct this.

@IniZio IniZio requested a review from louischan-oursky March 8, 2024 07:48
@louischan-oursky louischan-oursky merged commit d34b5b0 into authgear:master Mar 8, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants