mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 15:00:01 -04:00
sync xhr as a flag
This commit is contained in:
parent
8ad6f644e8
commit
8cbb949e21
3 changed files with 8 additions and 0 deletions
|
@ -26,6 +26,12 @@ export default function (client: ScramjetClient, self: Self) {
|
|||
const args = ctx.this[ARGS];
|
||||
if (!args || args[2]) return;
|
||||
|
||||
if (!self.$scramjet.config.flags.syncxhr) {
|
||||
console.warn("sync xhr disabled in flags");
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// it's a sync request
|
||||
// sync xhr to service worker is not supported
|
||||
// there's a nice way of polyfilling this though, we can spin on an atomic using sharedarraybuffer. this will maintain the sync behavior
|
||||
|
|
|
@ -31,6 +31,7 @@ export class ScramjetController {
|
|||
serviceworkers: false,
|
||||
naiiveRewriter: false,
|
||||
captureErrors: true,
|
||||
syncxhr: false,
|
||||
cleanerrors: false,
|
||||
sourcemaps: false,
|
||||
},
|
||||
|
|
1
src/types.d.ts
vendored
1
src/types.d.ts
vendored
|
@ -25,6 +25,7 @@ type ScramjetFlags = {
|
|||
captureErrors: boolean;
|
||||
cleanerrors: boolean;
|
||||
sourcemaps: boolean;
|
||||
syncxhr: boolean;
|
||||
};
|
||||
|
||||
interface ScramjetConfig {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue