Brave-ios: HTML tags should be removed when classifying a page for Brave ads

Created on 7 Nov 2019  路  4Comments  路  Source: brave/brave-ios

Description:

HTML tags should be removed when classifying a page for Brave ads otherwise the classifier will likely return "Technology & Computing-Software"

Steps to Reproduce

  1. Enable Brave Rewards
  2. Visit www.law.com

Actual result:
Page is classified as "technology & computing-software"

Expected result:
Page should be classified as "law-law"

Reproduces how often: [Easily reproduced, Intermittent Issue]
Easily reproduced

Brave Version:

Device details:

Website problems only:

  • did you check with Brave Shields down?
  • did you check in Safari/Firefox (WkWebView-based browsers)?

Additional Information

Search for "Successfully classified page at" in the logs to see the page classification

Rewards QA Pass - iPad QA Pass - iPhone QA Pass - iPhone X QYes bug release-noteexclude

Most helpful comment

We're going to just use document.body.innerText as it provides the most accurate and quickest solution

All 4 comments

Only stripping html tags is enough, or do we need to do more like extracting only <body> contents or removing css/script contents?

We're going to just use document.body.innerText as it provides the most accurate and quickest solution

I can confirm that tests @kylehickinson showed me using document.body.innerText are as good as the desktop page classification

Verification passed on iPhone XR with iOS 13.2 running 1.14(19.11.22.15)

  • Verified page classification is done correctly

iPhone XRlog.txt

Verification passed on iPhone 7+ with iOS 13.2 running 1.14(19.11.22.15)

  • Verified page classification is done correctly

iPhone7+log.txt

Verification passed on iPhone 6 with iOS 12.4 running 1.14(19.11.22.15)

  • Verified page classification is done correctly

iPhone6Log.txt

Verification passed on iPad Pro with iOS 13.2 running 1.14(19.11.22.15)

  • Verified page classification is done correctly

iPad13log.txt

Verification passed on iPad Pro with iOS 12.4 running 1.14(19.11.22.15)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bsclifton picture bsclifton  路  4Comments

oloverm picture oloverm  路  6Comments

iccub picture iccub  路  4Comments

srirambv picture srirambv  路  6Comments

kjozwiak picture kjozwiak  路  4Comments