mirror of
https://github.com/jellyfin/jellyfin-media-player.git
synced 2024-11-27 00:00:38 +00:00
Fix find-webclient for baseurls.
This commit is contained in:
parent
1075ff722c
commit
3f31831a7e
@ -7,7 +7,7 @@ async function tryConnect(server) {
|
||||
}
|
||||
server = server.replace(/\/+$/, "");
|
||||
|
||||
const url = new URL("/System/Info/Public", server);
|
||||
const url = server + "/System/Info/Public";
|
||||
const response = await fetch(url);
|
||||
if (response.ok && (await response.json()).Id) {
|
||||
const htmlResponse = await fetch(server);
|
||||
@ -29,16 +29,16 @@ async function tryConnect(server) {
|
||||
const base = doc.createElement("base");
|
||||
base.href = webUrl
|
||||
doc.head.insertBefore(base, doc.head.firstChild);
|
||||
|
||||
|
||||
const oldPushState = window.history.pushState;
|
||||
window.history.pushState = function(state, title, url) {
|
||||
url = (new URL(url, realUrl)).toString();
|
||||
url = url ? (new URL(url, realUrl)).toString() : realUrl;
|
||||
return oldPushState.call(window.history, state, title, url);
|
||||
};
|
||||
|
||||
const oldReplaceState = window.history.replaceState;
|
||||
window.history.replaceState = function(state, title, url) {
|
||||
url = (new URL(url, realUrl)).toString();
|
||||
url = url ? (new URL(url, realUrl)).toString() : realUrl;
|
||||
return oldReplaceState.call(window.history, state, title, url);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user