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

@Match problem (not ports) #2715

Closed
Owyn opened this Issue Nov 20, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@Owyn

Owyn commented Nov 20, 2017

Just noticeed that after migration to new FF and GM4 my match:
// @match *://*.gelbooru.com/index.php?page=post&s=view&id=*
no longer fires on url (example)
https://gelbooru.com/index.php?page=post&s=view&id=2865115

while simple // @match *://*.gelbooru.com/*
fires on that url

was working perfectly in GM3, but in GM4 it has this weird bug...

whole script if you wonder: https://github.com/Owyn/HandyImage/raw/master/HandyImage.user.js

@arantius arantius added this to the 4.1 milestone Nov 21, 2017

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Nov 21, 2017

Collaborator

Ok inside MatchPattern.doMatch we're doing this._pathExpr.test(url.pathname) but pathname is just /index.php. We need to test this._pathExpr.test(url.pathname + url.search).

Collaborator

arantius commented Nov 21, 2017

Ok inside MatchPattern.doMatch we're doing this._pathExpr.test(url.pathname) but pathname is just /index.php. We need to test this._pathExpr.test(url.pathname + url.search).

@NoneGiven

This comment has been minimized.

Show comment
Hide comment
@NoneGiven

NoneGiven Nov 21, 2017

Contributor

Also, a @match like this:

// @match https://example.com/path

Will fire on a page like this:

https://example.com/path?query=whatever

Based on your explanation, this would be fixed with the same code change. Just documenting it anyway.

Contributor

NoneGiven commented Nov 21, 2017

Also, a @match like this:

// @match https://example.com/path

Will fire on a page like this:

https://example.com/path?query=whatever

Based on your explanation, this would be fixed with the same code change. Just documenting it anyway.

@tobbexiv

This comment has been minimized.

Show comment
Hide comment
@tobbexiv

tobbexiv Nov 21, 2017

Contributor

This is due to the same matching issue arantius explained. Everything of the search query is not considered in the matching. In your case it is ?query=whatever what is ignored at all.

Contributor

tobbexiv commented Nov 21, 2017

This is due to the same matching issue arantius explained. Everything of the search query is not considered in the matching. In your case it is ?query=whatever what is ignored at all.

arantius added a commit that referenced this issue Dec 1, 2017

Merge pull request #2732 from NoneGiven/matchpattern-querystring
Include query string in MatchPattern URL test

Fixes #2715
@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Dec 5, 2017

Collaborator

This fix should be in 4.1beta6; testing and confirming this would be very appreciated!

https://addons.mozilla.org/firefox/downloads/file/800957/greasemonkey-4.1beta6-an+fx.xpi?src=devhub

Collaborator

arantius commented Dec 5, 2017

This fix should be in 4.1beta6; testing and confirming this would be very appreciated!

https://addons.mozilla.org/firefox/downloads/file/800957/greasemonkey-4.1beta6-an+fx.xpi?src=devhub

@NoneGiven

This comment has been minimized.

Show comment
Hide comment
@NoneGiven

NoneGiven Dec 5, 2017

Contributor

@arantius Seeing my query string matching scripts run where they're supposed to now in FF 57 (well, except for in frames).

Contributor

NoneGiven commented Dec 5, 2017

@arantius Seeing my query string matching scripts run where they're supposed to now in FF 57 (well, except for in frames).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment