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

UBO > Advanced > Save/Revert buttons do not seem to work #8

Closed
z31r4m opened this issue Dec 7, 2016 · 1 comment
Closed

UBO > Advanced > Save/Revert buttons do not seem to work #8

z31r4m opened this issue Dec 7, 2016 · 1 comment

Comments

@z31r4m
Copy link

z31r4m commented Dec 7, 2016

Describe the issue

It seems that the Advanced > Save/Revert Controls (see screenshot at URL don't seem to work.

Screenshot in which the issue can be seen

[Screenshot(s) for visual issues are mandatory]

Please see screenshot at: http://i.imgur.com/EVBJh3c.png

or

screen_shot_2016-12-07_at_08_21_03

Buttons pointed to seem to be disabled.

Steps for anyone to reproduce the issue

  1. Go to UBo Settings and enable "I am an advanced user (required reading)" checkbox.
  2. Open a new Safari tab, and go to a website, like this one, github.com.
  3. Click on Safari > UBo button and then either "requests blocked" or "domains connected"
  4. See the screenshot with advanced controls? Click on 'github.com' in the table to make "all green"
  5. "Save" "Revert" buttons appear.
  6. Press to Save.

RESULT: Nothing happens. Tried with tooltips on and off.

Your settings

  • Safari version: Regressed with Safari 10 and TP 18
  • uBlock Origin version: 1.1.10.a3
  • MacOS version:10.12.
Your filter lists

Unset EasyList & Fanboy,
Enabled Fanboy+Easy Mega Filters.

Your custom filters (if any)

(update) WORKAROUND: User can still use "green/red" controls and then go to UBo > Settings > "My Rules" to commit the temporary rules they just made in the UI as permanent rules...

@el1t
Copy link
Owner

el1t commented Dec 9, 2016

(For future reference)

The root of these problems stem from here, when hostnameDict is initialized to Object.create(null) instead of {}, likely for performance reasons (=== undefined vs hasOwnProperty). It seems that other browsers will give hostnameDict a prototype when passing it through messages. However, Safari does not, so there are a few solutions:

  1. Use Object.prototype.hasOwnProperty.call regardless of what hostnameDict is
  2. Set all hostnameDict = {} and use hasOwnProperty
  3. Set all hostnameDict = Object.create(null) and use === undefined

I will implement the third for now.

@el1t el1t closed this as completed in 764e1db Dec 9, 2016
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

No branches or pull requests

2 participants