Closed robinwit closed 2 years ago
@robinwit ports are ignored with match patterns, meaning you get access to all ports
http://syno.local/*
should work
if it doesn't let me know and alternatively you could use a regex pattern with @include
@include
works with http://syno:8112/*
, thanks! Could have found that, thanks for taking the time to reply.
@match
didn't work with either of these:
@robinwit
What was the url of the page you were trying to match to?
Ports should simply be ignored with @match
. The url props for http://syno.local:8112/foo
would be:
["href": "http://syno.local:8112/foo", "pathname": "/foo", "protocol": "http:", "host": "syno.local"]
which should match against the following pattern: http://syno.local/*
Oh… It gets more interesting… :D
@match http://syno.local/*
works when visiting http://syno.local:8112
(I must have visited the url without .local
before)
@match http://syno/*
does not work when visiting http://syno:8112
But actually, I have other services running on other ports, so I really need to be able to include the port.
@match http://syno/*
does not work when visitinghttp://syno:8112
In the current implementation, you can only omit the .tld
if you are using a singular wildcard *
. Examples of valid match patterns:
*
https://*.google.com/*
*://*.net/*
https://example.org/foo/bar.html
Something like http://syno/*
would be seen as an invalid pattern with the current implementation. I believe the change would be marginal to allow for patterns like that or, say, *://localhost/*
- however ports will always be ignored with @match
.
You can see the regex for the match parts here: ^(http:|https:|\*:)\/\/((?:\*\.)?(?:[a-z0-9-]+\.)+(?:[a-z0-9]+)|\*\.[a-z]+|\*)(\/[^\s]*)$
Changing that to the following, should allow for hosts without .tld
: ^(http:|https:|\*:)\/\/((?:\*\.)?(?:[a-z0-9-]+\.)+(?:[a-z0-9]+)|\*\.[a-z]+|\*|[a-z0-9]+)(\/[^\s]*)$
- this would give us the following host patterns:
(?:\*\.)?(?:[a-z0-9-]+\.)+(?:[a-z0-9]+)
- https://www.example.foo/page
\*\.[a-z]+
- https://*.example.foo/page
\*
- https://*/page
[a-z0-9]+
- https://example/*
(not currently implemented)updates in beta build ^
System Information:
Injection doesn't seem to work for url's pointing to a machine on the local network, could be related to the port number as well. This is the output from the script:
My user stylesheet:
Combinations I tried for
@match
:The only thing that works is
<all_urls>
.