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

V4 @match behaves differently than V3 and TamperMonkey #2673

Closed
kitor opened this Issue Nov 15, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@kitor

kitor commented Nov 15, 2017

My script has following entries (sanitized at those are intranet addresses):

// @match        http://*.some-net.net/*
// @match        http://*.some-net.net/*
// @match        https://*.some-othernet.net/*
// @match        https://*.some-othernet.net/*

On V3/tampermonkey it works for all following addresses examples (both http and https)

[1] service.some-net.net
[2] service.some-othernet.net
[3] service.some-net.net:1234
[4] service.some-othernet.net:1234
[5] service.customer.some-net.net:1234
[6] service.customer.location.some-net.net

Hovewer on V4 [3][4] and [5] does not work. For [3] fix was to add those to match the port too:

// @match        http://*.some-net.net:*/*
// @match        http://*.some-net.net:*/*
// @match        https://*.some-othernet.net:*/*
// @match        https://*.some-othernet.net:*/*

As for [5] i tried this, but even it does not help

// @match        http://*.*.some-net.net:*/*
// @match        http://*.*.some-net.net:*/*
// @match        https://*.*.some-othernet.net:*/*
// @match        https://*.*.some-othernet.net:*/*

And this does not make any sense for me as [6] work on first (original) rule set alone.

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

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Nov 15, 2017

Collaborator

The official documentation is terse and doesn't mention ports at all. Will be sure to include a test when fixing, to prevent regressions.

That said comparing the new/old code:

I'm unclear how this happened, it didn't change.

Collaborator

arantius commented Nov 15, 2017

The official documentation is terse and doesn't mention ports at all. Will be sure to include a test when fixing, to prevent regressions.

That said comparing the new/old code:

I'm unclear how this happened, it didn't change.

@kitor

This comment has been minimized.

Show comment
Hide comment
@kitor

kitor Nov 15, 2017

Well, maybe something changed in method that is used to get current URL. Everyone with new Firefox has this issue, for others using old FF/Chrome it's working.
Unfortunately when I wanted to modify XPI to add some prints I found that it needs to be signed....

kitor commented Nov 15, 2017

Well, maybe something changed in method that is used to get current URL. Everyone with new Firefox has this issue, for others using old FF/Chrome it's working.
Unfortunately when I wanted to modify XPI to add some prints I found that it needs to be signed....

@Sxderp

This comment has been minimized.

Show comment
Hide comment
@Sxderp

Sxderp Nov 15, 2017

Contributor

There's a Bugzilla about match and ports. Not sure what the resolution was. Will see if I can find it.

Contributor

Sxderp commented Nov 15, 2017

There's a Bugzilla about match and ports. Not sure what the resolution was. Will see if I can find it.

@Sxderp

This comment has been minimized.

Show comment
Hide comment
@Sxderp

Sxderp Nov 15, 2017

Contributor

Buzilla on match and ports. Here.

Contributor

Sxderp commented Nov 15, 2017

Buzilla on match and ports. Here.

@arantius

This comment has been minimized.

Show comment
Hide comment
@arantius

arantius Dec 4, 2017

Collaborator

Ok, back in 3.x days we used nsIURI, which had separately host, port, and hostport. Now we have to use URL which still has something called host -- but it means hostport. We need to use hostname.

Collaborator

arantius commented Dec 4, 2017

Ok, back in 3.x days we used nsIURI, which had separately host, port, and hostport. Now we have to use URL which still has something called host -- but it means hostport. We need to use hostname.

arantius added a commit to arantius/greasemonkey that referenced this issue Dec 4, 2017

@Sxderp

This comment has been minimized.

Show comment
Hide comment
@Sxderp

Sxderp Dec 4, 2017

Contributor

Not directly related to the problem functionality, but guarantees compatibility with FF implementation. Should said API be implemented.

https://bugzilla.mozilla.org/show_bug.cgi?id=1395278

Contributor

Sxderp commented Dec 4, 2017

Not directly related to the problem functionality, but guarantees compatibility with FF implementation. Should said API be implemented.

https://bugzilla.mozilla.org/show_bug.cgi?id=1395278

@arantius arantius closed this in 8c15a0b Dec 5, 2017

@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

@kitor

This comment has been minimized.

Show comment
Hide comment
@kitor

kitor Dec 5, 2017

Checked now and seems to work properly. Thanks!

kitor commented Dec 5, 2017

Checked now and seems to work properly. Thanks!

badbrainz added a commit to badbrainz/greasemonkey that referenced this issue Dec 20, 2017

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