mirror of
https://github.com/arfct/itty-bitty.git
synced 2026-03-11 08:54:33 +00:00
Update path components
This commit is contained in:
parent
e1f66e5de5
commit
61c008a378
1 changed files with 5 additions and 5 deletions
|
|
@ -47,11 +47,11 @@
|
|||
if (e.data.title) document.title = e.data.title;
|
||||
if (e.data.favicon) setFavicon(e.data.favicon);
|
||||
if (e.data.updateURL) {
|
||||
let path = "/" + e.data.title.replace(/\s/g, "-");
|
||||
if (e.data.description) path += "/d/" + encodeURIComponent(e.data.description);
|
||||
if (e.data.favicon) path += "/f/" + encodeURIComponent(e.data.favicon);
|
||||
if (e.data.image) path += "/i/" + encodeURIComponent(btoa(e.data.image));
|
||||
window.location.pathname = path;
|
||||
let path = ["/" + e.data.title.replace(/\s/g, "-")];
|
||||
if (e.data.description) path.push("d/" + encodeURIComponent(e.data.description));
|
||||
if (e.data.favicon) path.push("f/" + encodeURIComponent(e.data.favicon));
|
||||
if (e.data.image) path.push("i/" + encodeURIComponent(btoa(e.data.image)));
|
||||
window.location.pathname = path.join('/');
|
||||
}
|
||||
if (e.data.replaceURL) {
|
||||
window.history.replaceState(null, null, e.data.replaceURL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue