From 390faf0a296652ac41cd35cfd1cada8ea2fefc8c Mon Sep 17 00:00:00 2001 From: Justin Georgi Date: Tue, 10 Sep 2024 17:41:20 -0700 Subject: [PATCH] Replace url parse with new url for safari Signed-off-by: Justin Georgi --- .gitignore | 5 +++-- src/pages/detect.vue | 11 ++++++++--- src/pages/home.vue | 8 ++++++-- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index 0d397cf..e7537e7 100644 --- a/.gitignore +++ b/.gitignore @@ -40,7 +40,8 @@ cordova/platforms/ cordova/plugins/ cordova/www/ - - # Production build www/ + +# VSCode settings +.vscode/settings.json diff --git a/src/pages/detect.vue b/src/pages/detect.vue index 16577e4..36e2311 100644 --- a/src/pages/detect.vue +++ b/src/pages/detect.vue @@ -205,9 +205,14 @@ this.activeRegion = 3 break; } - this.modelLocation = URL.parse(`../models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json`,import.meta.url).href - this.miniLocation = URL.parse(`../models/${this.detectorName}-mini/model.json`,import.meta.url).href - fetch(URL.parse(`../models/${this.detectorName}/classes.json`,import.meta.url).href) + let modelJ = `../models/${this.detectorName}${this.otherSettings.mini ? '-mini' : ''}/model.json` + let miniJ = `../models/${this.detectorName}-mini/model.json` + this.modelLocation = new URL(modelJ,import.meta.url).href + this.miniLocation = new URL(miniJ,import.meta.url).href + console.log(this.modelLocation) + console.log(this.miniLocation) + let classesJ = `../models/${this.detectorName}/classes.json` + fetch(new URL(classesJ,import.meta.url).href) .then((mod) => { return mod.json() }) .then((classes) => { this.classesList = classes diff --git a/src/pages/home.vue b/src/pages/home.vue index 0de321b..edc216d 100644 --- a/src/pages/home.vue +++ b/src/pages/home.vue @@ -97,8 +97,7 @@