diff --git a/ts/index.ts b/ts/index.ts index b8f2142..2031d59 100644 --- a/ts/index.ts +++ b/ts/index.ts @@ -2,38 +2,32 @@ import * as plugins from './websetup.plugins'; import { setupGoogleAnalytics } from './tools/ganalytics'; import { setupFullStory } from './tools/fullstory'; -import { setupServiceWoker } from './serviceworker'; import { IMetaObject, setupMetaInformation } from './meta'; export interface IWebSetupConstructorOptions { googleAnalyticsCode?: string; fsCode?: string; metaObject: IMetaObject; - serviceworker?: boolean; } /** * the main WebSetup class */ export class WebSetup { + public options: IWebSetupConstructorOptions; constructor(optionsArg: IWebSetupConstructorOptions) { - // most important, lets get the meta information in place - this.setup(optionsArg); + this.options = optionsArg; } - async setup(optionsArg: IWebSetupConstructorOptions) { - await setupMetaInformation(optionsArg.metaObject); + public async setup() { + await setupMetaInformation(this.options.metaObject); - if (optionsArg.serviceworker) { - await setupServiceWoker(); + if (this.options.googleAnalyticsCode) { + await setupGoogleAnalytics(this.options.googleAnalyticsCode); } - if (optionsArg.googleAnalyticsCode) { - await setupGoogleAnalytics(optionsArg.googleAnalyticsCode); - } - - if (optionsArg.fsCode) { - await setupFullStory(optionsArg.fsCode); + if (this.options.fsCode) { + await setupFullStory(this.options.fsCode); } } } diff --git a/ts/serviceworker/index.ts b/ts/serviceworker/index.ts deleted file mode 100644 index 0afb585..0000000 --- a/ts/serviceworker/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -export const setupServiceWoker = async () => { - // serviceworker - const script = document.createElement('script'); - script.onload = () => { - console.log( - 'Loaded Serviceworker. The serviceworker helps us with notifications and offline capabilities, so you can also read this site when your device is offline.' - ); - }; - script.src = 'serviceworker/mainthread.js'; - document.head.appendChild(script); -};