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

Using an alias for custom scriptlet in my Filters pane is seen as invalid #1419

Closed
7 of 8 tasks
uBlock-user opened this issue Dec 27, 2020 · 6 comments
Closed
7 of 8 tasks
Labels
bug Something isn't working fixed issue has been addressed

Comments

@uBlock-user
Copy link
Contributor

uBlock-user commented Dec 27, 2020

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

As above.

A specific URL where the issue occurs

myFilters pane

Steps to Reproduce

  • Set userResourcesLocation to https://raw.githubusercontent.com/uBlock-user/uBO-Scriptlets/master/scriptlets.js

  • Navigate to my Filters and type/add, example.com##+js(noaif)

  • uBO sees the alias as invalid --
    Capture

Expected behavior:

Alias shouldn't be seen as invalid.

Actual behavior:

Alias is seen as invalid

Your environment

  • uBlock Origin version: 1.32.3b1/1.32.0
  • Browser Name and version: Firefox 84/86
  • Operating System and version: Win X
@uBlock-user uBlock-user added the bug Something isn't working label Dec 27, 2020
@uBlock-user
Copy link
Contributor Author

uBlock-user commented Dec 27, 2020

Addendum: Any scriptlet which is the last one in the userResourcesLocation URL will have its alias seen as invalid by uBO.

Regressed by gorhill/uBlock@24755d4 ?

@uBlock-user uBlock-user changed the title Using an alias for a specific custom scriptlet in my Filters pane is seen as invalid Using an alias for custom scriptlet in my Filters pane is seen as invalid Dec 27, 2020
@gwarser
Copy link

gwarser commented Dec 27, 2020

You need to put at least two new lines at the end of the resource file, or even better some comment to be sure these lines are here. Otherwise section after last continue is skipped, loop is not executed one more time because this is already eot() (maybe this.offset = lineEnd + 1; is set to soon in LineIterator?):

https://github.com/gorhill/uBlock/blob/1d2907890bedafa39488ecc3fcb688f850374242/src/js/redirect-engine.js#L396-L419

@uBlock-user
Copy link
Contributor Author

Is this a new change with 1.32.0 ? Not seeing this happening with 1.31.0.

@gwarser
Copy link

gwarser commented Dec 27, 2020

Ah, just after the while loop code is not updated after gorhill/uBlock@24755d4 :

https://github.com/gorhill/uBlock/blob/1d2907890bedafa39488ecc3fcb688f850374242/src/js/redirect-engine.js#L423-L435


image

@uBlock-user
Copy link
Contributor Author

Added a new line and it works now..until gorhill addresses it.

@gorhill
Copy link
Member

gorhill commented Dec 27, 2020

I just need to append two newlines to the raw text so that I can drop that redundant block outside the loop.

gorhill added a commit to gorhill/uBlock that referenced this issue Dec 28, 2020
@uBlock-user uBlock-user added the fixed issue has been addressed label Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed issue has been addressed
Projects
None yet
Development

No branches or pull requests

3 participants