mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 15:49:19 +08:00
feat: 浏览器扩展完全支持热更新
This commit is contained in:
@@ -125,9 +125,9 @@ async function handleOpenFeature(item: ExtensionFeatureItem) {
|
||||
? `远程脚本已校验(${item.version})`
|
||||
: `已下载远程脚本(未配置 sha256)`;
|
||||
|
||||
await mountFeatureOnPage(item.id);
|
||||
await mountFeatureOnPage(item.id, remote.code);
|
||||
activeFeatureId.value = item.id;
|
||||
statusText.value = `已打开:${item.name}`;
|
||||
statusText.value = `已打开:${item.name}(远程脚本)`;
|
||||
} catch (error) {
|
||||
errorText.value = toUserMessage(error);
|
||||
} finally {
|
||||
|
||||
@@ -49,10 +49,13 @@ export async function getFloatingPanelState(): Promise<{ visible: boolean }> {
|
||||
return sendToActiveTab<{ visible: boolean }>({ type: 'GET_FLOATING_PANEL_STATE' });
|
||||
}
|
||||
|
||||
export async function mountFeatureOnPage(featureId: string): Promise<{ featureId: string | null }> {
|
||||
export async function mountFeatureOnPage(
|
||||
featureId: string,
|
||||
code: string,
|
||||
): Promise<{ featureId: string | null }> {
|
||||
return sendToActiveTab<{ featureId: string | null }>({
|
||||
type: 'MOUNT_FEATURE',
|
||||
payload: { featureId },
|
||||
payload: { featureId, code },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user