Opened 3 months ago

Last modified 3 months ago

#7241 new defect

Missing syntax validation and error message in input "Add domain"

Reported by: jchee Assignee:
Priority: Unknown Milestone:
Module: Libadblockplus-Android Keywords:
Cc: Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Environment

Orca 0.3.0
Android 8.0.0

How to reproduce

  1. Go to "Settings" on Orca
  2. Then navigate to "Ad blocking" > "Whitelisted domain"
  3. In the "Add domain" input, try entering ||example.com
  4. The input is accepted

Also, try to reproduce this:
(starting from step 3)

  1. Attempt to add @@||example.com and proceed to tap on the (+) icon
  2. (+) icon does not work, and input is not accepted

...

Observed behaviour

||example.com is accepted as an input while @@||example.com is not, but no error message shows up.

[Screenshot link](https://gitlab.com/eyeo/adblockplus/orca-android/uploads/ce80902c26f40ab86a29ac089a5f8a5b/photo6222203286350571588.jpg)

Expected behaviour

The input text should only accept valid domains and show error messages or disable the add/ok button when the input is wrong

Change History (1)

comment:1 Changed 3 months ago by aboegler

I also wanted to add to the expected behavior that the input field should only accept domains once, as it's currently possible whitelist the same domain multiple times by entering it in the "Add domain" input again.


Steps to reproduce

  1. Launch Orca (or ABP Chromium)
  2. Tap the meatballs menu, then Settings
  3. Navigate to Ad blocking > Whitelisted domains
  4. Enter "wikipedia.org" in the Add domain field and press +
  5. Enter "wikipedia.org" in the Add domain field and press + again

Expected result

An error message is displayed as the domain is already in the list below.

Actual result

A duplicate entry of the domain is added to the list.


In Orca specifically, this causes an issue when trying to un-whitelist a site through the ABP popup menu in the toolbar: tapping the "Block annoying ads" switch to turn it back on reloads the page, but the switch stays off, and ads are not blocked. You need to repeat the process as many times as there are entries of that domain name in the whitelisted domains list, as it only deletes one at a time.

Note: See TracTickets for help on using tickets.