|
@@ -6,7 +6,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="search-wrapper">
|
|
<div class="search-wrapper">
|
|
<input class="input" type="text" v-model="siteUrl" placeholder="Enter link">
|
|
<input class="input" type="text" v-model="siteUrl" placeholder="Enter link">
|
|
- <div class="btn" @click="searchHandler">
|
|
|
|
|
|
+ <div class="btn" @click="searchHandler()">
|
|
<img :src="require('@/assets/svg/icon-tool-box-search-arrow.svg')" />
|
|
<img :src="require('@/assets/svg/icon-tool-box-search-arrow.svg')" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -68,6 +68,7 @@ const props = defineProps({
|
|
let siteUrl = ref('');
|
|
let siteUrl = ref('');
|
|
|
|
|
|
let selectAppGuideData = {};
|
|
let selectAppGuideData = {};
|
|
|
|
+let selectGuideApp = {};
|
|
let openWindowList = [];
|
|
let openWindowList = [];
|
|
|
|
|
|
let historyList = ref([])
|
|
let historyList = ref([])
|
|
@@ -76,7 +77,7 @@ let appList = ref();
|
|
|
|
|
|
const emits = defineEmits(["changeShowCom"]);
|
|
const emits = defineEmits(["changeShowCom"]);
|
|
|
|
|
|
-const searchHandler = async () => {
|
|
|
|
|
|
+const searchHandler = async (_params) => {
|
|
let siteTitle = '', favicon = '';
|
|
let siteTitle = '', favicon = '';
|
|
let timer = null;
|
|
let timer = null;
|
|
|
|
|
|
@@ -106,15 +107,16 @@ const searchHandler = async () => {
|
|
createType: '',
|
|
createType: '',
|
|
defaultUrl: siteUrl.value,
|
|
defaultUrl: siteUrl.value,
|
|
guideData: '',
|
|
guideData: '',
|
|
- iconPath: favicon,
|
|
|
|
|
|
+ iconPath: '',
|
|
interactType: '',
|
|
interactType: '',
|
|
- linkImagePath: "",
|
|
|
|
- name: siteTitle,
|
|
|
|
|
|
+ linkImagePath: '',
|
|
|
|
+ name: '',
|
|
}
|
|
}
|
|
|
|
|
|
if (siteRes) {
|
|
if (siteRes) {
|
|
- if (siteRes.headers['content-type'].indexOf('text/html') < 0 || siteRes.request.status > 399) {
|
|
|
|
- // 提示
|
|
|
|
|
|
+ if (siteRes.headers['content-type'].indexOf('text/html') < 0 || siteRes.request.status > 403) {
|
|
|
|
+ loadingHide();
|
|
|
|
+ message.error('Page loading failed');
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
let urlObj = new URL(siteUrl.value);
|
|
let urlObj = new URL(siteUrl.value);
|
|
@@ -124,10 +126,16 @@ const searchHandler = async () => {
|
|
siteTitle = urlObj.hostname;
|
|
siteTitle = urlObj.hostname;
|
|
currentApp.defaultTit = siteTitle;
|
|
currentApp.defaultTit = siteTitle;
|
|
}
|
|
}
|
|
|
|
+ currentApp.name = siteTitle;
|
|
}
|
|
}
|
|
favicon = urlObj.origin + '/favicon.ico';
|
|
favicon = urlObj.origin + '/favicon.ico';
|
|
}
|
|
}
|
|
|
|
+ currentApp.iconPath = favicon;
|
|
|
|
|
|
|
|
+ if(_params) {
|
|
|
|
+ currentApp = _params;
|
|
|
|
+ }
|
|
|
|
+
|
|
let convertRes = await convertUrl({ params: { originUrl: siteUrl.value } });
|
|
let convertRes = await convertUrl({ params: { originUrl: siteUrl.value } });
|
|
let params = { convertUrl: siteUrl.value, originUrl: siteUrl.value, appId: '', currentApp };
|
|
let params = { convertUrl: siteUrl.value, originUrl: siteUrl.value, appId: '', currentApp };
|
|
|
|
|
|
@@ -159,7 +167,7 @@ const clickHistoryAppHandler = (params) => {
|
|
clickAppHandler(params);
|
|
clickAppHandler(params);
|
|
} else {
|
|
} else {
|
|
siteUrl.value = params.defaultUrl;
|
|
siteUrl.value = params.defaultUrl;
|
|
- searchHandler();
|
|
|
|
|
|
+ searchHandler(params);
|
|
}
|
|
}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -195,6 +203,7 @@ const openWindow = (params) => {
|
|
const createGuideWindow = (params, isUpdate = false) => {
|
|
const createGuideWindow = (params, isUpdate = false) => {
|
|
openWindowList = [];
|
|
openWindowList = [];
|
|
selectAppGuideData = {};
|
|
selectAppGuideData = {};
|
|
|
|
+ selectGuideApp = {};
|
|
|
|
|
|
let windowWith = window.screen.width - 500;
|
|
let windowWith = window.screen.width - 500;
|
|
let guideUrl = chrome.runtime.getURL('/iframe/tool-box-guide.html');
|
|
let guideUrl = chrome.runtime.getURL('/iframe/tool-box-guide.html');
|
|
@@ -216,7 +225,7 @@ const createGuideWindow = (params, isUpdate = false) => {
|
|
}, function (window) {
|
|
}, function (window) {
|
|
openWindowList.push(window);
|
|
openWindowList.push(window);
|
|
})
|
|
})
|
|
-
|
|
|
|
|
|
+ selectGuideApp = params;
|
|
if (params.guideData) {
|
|
if (params.guideData) {
|
|
selectAppGuideData = JSON.parse(params.guideData);
|
|
selectAppGuideData = JSON.parse(params.guideData);
|
|
}
|
|
}
|
|
@@ -240,13 +249,14 @@ const onRuntimeMsg = () => {
|
|
actionType: "CONTENT_EDIT_SEND_GUIDE_DATA",
|
|
actionType: "CONTENT_EDIT_SEND_GUIDE_DATA",
|
|
data: {
|
|
data: {
|
|
guideData: selectAppGuideData,
|
|
guideData: selectAppGuideData,
|
|
- windowData: openWindowList
|
|
|
|
|
|
+ windowData: openWindowList,
|
|
|
|
+ selectGuideApp
|
|
}
|
|
}
|
|
}, (response) => { });
|
|
}, (response) => { });
|
|
break;
|
|
break;
|
|
case 'CONTENT_GUIDE_APPLY_APP':
|
|
case 'CONTENT_GUIDE_APPLY_APP':
|
|
siteUrl.value = req.data.siteUrl;
|
|
siteUrl.value = req.data.siteUrl;
|
|
- searchHandler();
|
|
|
|
|
|
+ searchHandler(req.data.selectGuideApp);
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
})
|
|
})
|