You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead it should only save provider and the URL suffix (not the main domain) and lookup the current url's main domain based on provider URL to let the provider handle it. As if mainUrl is changed it breaks existing entries.
We could handle backward compatibility too to make it work for existing entries by just parsing the URL parts and ignore the domain part and replace it with saved providers URL. As least in theory, I have not made any attempts at this yet.
Another theory I suppose could work is keep using mainurl but add something to UI like "Update cache" to recache the URL so it updates or some sort of expiry on it so it updates sometimes. Not exactly sure how to handle this as looking for the mainUrl in all providers could also have a negative performance impact.
I don't know if there is really a perfect solution to this either...
Other details
I will probably look at this later this is mostly just as a reminder for me.
Acknowledgements
My suggestion is NOT about adding a new provider
I have searched the existing issues and this is a new ticket, NOT a duplicate or related to another open issue.
The text was updated successfully, but these errors were encountered:
This should be up to the extension developer, as the url specified can and is often in other forms like json, or for other sites then the one specified by mainUrl. Because of this we can not reliably automate any sort of mechanism, however we can add a function like this to the api if needed.
/** * For APIs using the mainUrl in the prefix for `MainAPI::load`, * this function replaces the `scheme`, `host` and `port` from an old link to the new mainUrl. * * https://en.wikipedia.org/wiki/Uniform_Resource_Identifier * ```text * userinfo host port * ┌──┴───┐ ┌──────┴──────┐ ┌┴─┐ * https://[email protected]:1234/forum/questions/?tag=networking&order=newest#:~:text=whatever * └─┬─┘ └─────────────┬─────────────┘└───────┬───────┘ └────────────┬────────────┘ └───────┬───────┘ * scheme authority path query fragment * ```*/fun MainAPI.updateUrl(url:String): String {
try {
val original =URI(url)
val updated =URI(mainUrl)
// URI(String scheme, String userInfo, String host, int port, String path, String query, String fragment)returnURI(
updated.scheme,
original.userInfo,
updated.host,
updated.port,
original.path,
original.query,
original.fragment
).toString()
} catch (t:Throwable) {
logError(t)
return url
}
}
Describe your suggested feature
Instead it should only save provider and the URL suffix (not the main domain) and lookup the current url's main domain based on provider URL to let the provider handle it. As if mainUrl is changed it breaks existing entries.
We could handle backward compatibility too to make it work for existing entries by just parsing the URL parts and ignore the domain part and replace it with saved providers URL. As least in theory, I have not made any attempts at this yet.
Another theory I suppose could work is keep using mainurl but add something to UI like "Update cache" to recache the URL so it updates or some sort of expiry on it so it updates sometimes. Not exactly sure how to handle this as looking for the mainUrl in all providers could also have a negative performance impact.
I don't know if there is really a perfect solution to this either...
Other details
I will probably look at this later this is mostly just as a reminder for me.
Acknowledgements
The text was updated successfully, but these errors were encountered: