About UA settings in content, causing the page onpagestarted to be recalled again

Source: Internet
Author: User

It is said that in the technical team, leaders and employees will never look at the problem in an angle.

Well, let's not say the law of XX.


I made a Webview.java and two callbacks (Webviewclient.java and Webchromeclient.java) based on the Content API (CHROMIUM34), with this problem:

In the Onpagestarted method, the request UA is changed, which causes the onpagestarted method to be re-executed again.

In this way, some wonderful invocation logic cannot be satisfied.


Based on this, it is necessary to make an adjustment, how to make the request UA changed in the Onpagestarted method, theonpagestarted method will not be re-executed again.




The problem is: in the web_contents_impl.cc file, there are methods Setuseragentoverride, there are controller_. Reloadignoringcache (True).

This line of code is the culprit. Commented out, the previous issue does not occur.

About UA settings in content, causing the page onpagestarted to be recalled again

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.