revert unwanted changes
This commit is contained in:
parent
eb6c661bd4
commit
2c09cdd23b
|
|
@ -45,7 +45,7 @@ import { EmbeddedWorkbenchLoader } from './ui/embeddedWorkbenchLoader';
|
||||||
if (window.location.protocol !== 'file:') {
|
if (window.location.protocol !== 'file:') {
|
||||||
if (!navigator.serviceWorker)
|
if (!navigator.serviceWorker)
|
||||||
throw new Error(`Service workers are not supported.\nMake sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
|
throw new Error(`Service workers are not supported.\nMake sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
|
||||||
navigator.serviceWorker.register('sw.bundle.js' + window.location.search);
|
navigator.serviceWorker.register('sw.bundle.js');
|
||||||
if (!navigator.serviceWorker.controller) {
|
if (!navigator.serviceWorker.controller) {
|
||||||
await new Promise<void>(f => {
|
await new Promise<void>(f => {
|
||||||
navigator.serviceWorker.oncontrollerchange = () => f();
|
navigator.serviceWorker.oncontrollerchange = () => f();
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import { WorkbenchLoader } from './ui/workbenchLoader';
|
||||||
await new Promise(f => setTimeout(f, 1000));
|
await new Promise(f => setTimeout(f, 1000));
|
||||||
if (!navigator.serviceWorker)
|
if (!navigator.serviceWorker)
|
||||||
throw new Error(`Service workers are not supported.\nMake sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
|
throw new Error(`Service workers are not supported.\nMake sure to serve the Trace Viewer (${window.location}) via HTTPS or localhost.`);
|
||||||
navigator.serviceWorker.register('sw.bundle.js' + window.location.search);
|
navigator.serviceWorker.register('sw.bundle.js');
|
||||||
if (!navigator.serviceWorker.controller) {
|
if (!navigator.serviceWorker.controller) {
|
||||||
await new Promise<void>(f => {
|
await new Promise<void>(f => {
|
||||||
navigator.serviceWorker.oncontrollerchange = () => f();
|
navigator.serviceWorker.oncontrollerchange = () => f();
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ import { RecorderView } from './ui/recorder/recorderView';
|
||||||
if (window.location.protocol !== 'file:') {
|
if (window.location.protocol !== 'file:') {
|
||||||
if (!navigator.serviceWorker)
|
if (!navigator.serviceWorker)
|
||||||
throw new Error(`Service workers are not supported.\nMake sure to serve the Recorder (${window.location}) via HTTPS or localhost.`);
|
throw new Error(`Service workers are not supported.\nMake sure to serve the Recorder (${window.location}) via HTTPS or localhost.`);
|
||||||
navigator.serviceWorker.register('sw.bundle.js' + window.location.search);
|
navigator.serviceWorker.register('sw.bundle.js');
|
||||||
if (!navigator.serviceWorker.controller) {
|
if (!navigator.serviceWorker.controller) {
|
||||||
await new Promise<void>(f => {
|
await new Promise<void>(f => {
|
||||||
navigator.serviceWorker.oncontrollerchange = () => f();
|
navigator.serviceWorker.oncontrollerchange = () => f();
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ import type zip from '@zip.js/zip.js';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import * as zipImport from '@zip.js/zip.js/lib/zip-no-worker-inflate.js';
|
import * as zipImport from '@zip.js/zip.js/lib/zip-no-worker-inflate.js';
|
||||||
import type { TraceModelBackend } from './traceModel';
|
import type { TraceModelBackend } from './traceModel';
|
||||||
import { testServerBaseURL } from '../searchParams';
|
|
||||||
|
|
||||||
const zipjs = zipImport as typeof zip;
|
const zipjs = zipImport as typeof zip;
|
||||||
|
|
||||||
|
|
@ -31,6 +30,7 @@ export class ZipTraceModelBackend implements TraceModelBackend {
|
||||||
|
|
||||||
constructor(traceURL: string, progress: Progress) {
|
constructor(traceURL: string, progress: Progress) {
|
||||||
this._traceURL = traceURL;
|
this._traceURL = traceURL;
|
||||||
|
zipjs.configure({ baseURL: self.location.href } as any);
|
||||||
this._zipReader = new zipjs.ZipReader(
|
this._zipReader = new zipjs.ZipReader(
|
||||||
new zipjs.HttpReader(traceURL, { mode: 'cors', preventHeadRequest: true } as any),
|
new zipjs.HttpReader(traceURL, { mode: 'cors', preventHeadRequest: true } as any),
|
||||||
{ useWebWorkers: false });
|
{ useWebWorkers: false });
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ import { UIModeView } from './ui/uiModeView';
|
||||||
await new Promise(f => setTimeout(f, 1000));
|
await new Promise(f => setTimeout(f, 1000));
|
||||||
if (!navigator.serviceWorker)
|
if (!navigator.serviceWorker)
|
||||||
throw new Error(`Service workers are not supported.\nMake sure to serve the website (${window.location}) via HTTPS or localhost.`);
|
throw new Error(`Service workers are not supported.\nMake sure to serve the website (${window.location}) via HTTPS or localhost.`);
|
||||||
navigator.serviceWorker.register('sw.bundle.js' + window.location.search);
|
navigator.serviceWorker.register('sw.bundle.js');
|
||||||
if (!navigator.serviceWorker.controller) {
|
if (!navigator.serviceWorker.controller) {
|
||||||
await new Promise<void>(f => {
|
await new Promise<void>(f => {
|
||||||
navigator.serviceWorker.oncontrollerchange = () => f();
|
navigator.serviceWorker.oncontrollerchange = () => f();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue