Conversation
| installTranslator(translator); | ||
| loadTranslations(); | ||
|
|
||
| auto list = QUrl::idnWhitelist(); |
There was a problem hiding this comment.
Thanks, removing the .com fromPunycode() hack is a big improvement! Should we move the IDN whitelist initialization to a separate function initializeIdnWhitelist() with a comment that clarifies why this is needed and how this works? Perhaps also link to https://doc.qt.io/qt-6/qurl.html#setIdnWhitelist and https://github.com/qt/qtbase/blob/dev/src/corelib/io/qurlidna.cpp#L281-L318 in the comment. Note that "fi", "lt", "lv" already exist in https://github.com/qt/qtbase/blob/dev/src/corelib/io/qurlidna.cpp#L281-L318.
Also, see the discussion at https://qt-project.atlassian.net/browse/QTBUG-95597.
There was a problem hiding this comment.
I think the goal is to show same url as in browse.
Right now we are depending on Qt behavior and as you can see it is always not the same as in browser.
I think extension should send URL in format that is show in browser.
There was a problem hiding this comment.
Yes, that is the goal and this is a good suggestion, but the problem is that there is no API for getting the displayed URL. WebExtensions can read the actual URL, not the address bar’s rendered string. Internationalized domain name or punycode display is a browser UI decision, so we can’t match what the browser shows without reimplementing browser UI logic.
We only have access to MessageSender.url: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/MessageSender#url
Here's how the origin URL is constructed at the moment: https://github.com/web-eid/web-eid-webextension/blob/main/src/background/actions/authenticate.ts#L58
| QStringLiteral("MIIEAzCCA2WgAwIBAgIQOWkBW")); | ||
| } | ||
|
|
||
| void WebEidTests::fromPunycode_decodesEeDomain() |
There was a problem hiding this comment.
We should keep the test to verify that "https://xn--igusnunik-p7af.ee" is shown as "\u00F5igusn\u00F5unik.ee", use URL + QUrl::PrettyDecoded directly.
There was a problem hiding this comment.
again, extension should send correctly formated url
Add ee, fi, lt, lv to allowed IDN parsing list WE2-1173 Signed-off-by: Raul Metsma <raul@metsma.ee>
Add ee, fi, lt, lv to allowed IDN parsing list
WE2-1173
Signed-off-by: Raul Metsma raul@metsma.ee