IOS-Control user actions with the User-select attribute of OC Tuning JS when using Wkwebview

Source: Internet
Author: User

Called after page load is complete

-(void) WebView: (Wkwebview *) WebView didfinishnavigation: (null_unspecified wknavigation *) Navigation {

JS code that does not perform the popup list of the previous interface

[WebView evaluatejavascript:@ "document.documentelement.style.webkittouchcallout= ' none ';" Completionhandler:nil];

[WebView evaluatejavascript:@ "document.documentelement.style.webkituserselect= ' None '" completionhandler:nil];

}

The User-select property is used to prevent users from using the mouse to select text, images, etc. on the page, that is, to make the page content unavailable. You can also only allow users to select text, or all of them, users can select the text, but also include the text of the picture, video and other things. The User-select property is an element-level function that can affect not only the entire page, but also the specified element and its child elements.

Currently using a variety of browser engine prefix, it can play a good role.

Let's take a look at the syntax of the User-select property:

User-select:none;
User-select:auto;
User-select:text;
User-select:contain;
User-select:all;
Firefox browser
-moz-user-select:none;
-moz-user-select:text;
-moz-user-select:all;
Google Chrome
-webkit-user-select:none;
-webkit-user-select:text;
-webkit-user-select:all;
Ie
-ms-user-select:none;
-ms-user-select:text;
-ms-user-select:all;
-ms-user-select:element;

The following is an introduction to the property values for the "User-select" property:

none
Prevent users from checking
text
No restrictions on the user's choice
all
The
target element will be selected as a whole, that is, you cannot select only one part, and the browser automatically selects the contents of the entire element when you select the text with the mouse.

IOS-Control user actions with the User-select attribute of OC Tuning JS when using Wkwebview

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.