erosman / support

Support Location for all my extensions
Mozilla Public License 2.0
172 stars 12 forks source link

[FireMonkey] Scripts not working when @match URLs contain special characters #652

Open lumijaeger opened 1 month ago

lumijaeger commented 1 month ago

Firemonkey doesn´t recognize sites containing special characters, at least the character 'ñ'. I've already tried with these patterns, to no avail:

// @match          https://www.coruña.com/*
// @match          https://www.coru%C3%B1a.com/*
// @match          https://www.coru?a.com/*
erosman commented 1 month ago

Firemonkey doesn´t recognize sites containing special characters,...

FireMonkey passes the values to the Firefox API which uses Match Patterns . If there is an issue, it is that the Firefox API doesn't recognize the pattern.

However, this case is related to the JavaScript navigation where a site changes the content and URL using JavaScript.

You will see the result is https://www.xn--corua-rta.com/ which means the page is actually https://www.xn--corua-rta.com/ although the URL shows https://www.coruña.com/.

Try the following:

// ==UserScript==
// @name          Scripts not working when @match URLs contain special characters #652
// @match         https://www.coruña.com/*
// @match         https://www.xn--corua-rta.com/*
// ==/UserScript==

console.log(GM.info.script.name);

document.body.style.border = '1px solid red';