mirror of
https://github.com/arfct/itty-bitty.git
synced 2026-03-11 08:54:33 +00:00
allow compression request parameter
This commit is contained in:
parent
78d8967482
commit
dce356dff8
1 changed files with 10 additions and 0 deletions
|
|
@ -235,6 +235,16 @@
|
||||||
|
|
||||||
let durl = new bitty.DataURL(fragment);
|
let durl = new bitty.DataURL(fragment);
|
||||||
|
|
||||||
|
if (durl.params.compress) {
|
||||||
|
console.log("Compressing URL", durl);
|
||||||
|
delete durl.params.compress;
|
||||||
|
durl.compress(bitty.GZIP_MARKER).then(arg => {
|
||||||
|
window.history.replaceState(null, null, "/#/" + arg.href);
|
||||||
|
renderContent();
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
await durl.decompress();
|
await durl.decompress();
|
||||||
|
|
||||||
durl.dataPrefix = dataPrefix;
|
durl.dataPrefix = dataPrefix;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue