fix: 去掉自动下载 JSON,只下载 PPTX
This commit is contained in:
@@ -220,7 +220,7 @@ function arrayBufferToBase64(buffer) {
|
|||||||
|
|
||||||
// 消息处理
|
// 消息处理
|
||||||
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
||||||
// 采集并下载 JSON(兼容旧流程)
|
// 采集并缓存数据(不下载 JSON,由 popup 直接转化下载 PPTX)
|
||||||
if (message?.type === "WEB_TO_PPT_CAPTURE_START") {
|
if (message?.type === "WEB_TO_PPT_CAPTURE_START") {
|
||||||
(async () => {
|
(async () => {
|
||||||
const settings = normalizeSettings(message.options);
|
const settings = normalizeSettings(message.options);
|
||||||
@@ -229,10 +229,8 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|||||||
assertCaptureableTab(tab);
|
assertCaptureableTab(tab);
|
||||||
const data = await captureCurrentTab(tab, settings);
|
const data = await captureCurrentTab(tab, settings);
|
||||||
lastCaptureData = data; // 缓存数据
|
lastCaptureData = data; // 缓存数据
|
||||||
const filename = await downloadCapture(data);
|
|
||||||
return {
|
return {
|
||||||
ok: true,
|
ok: true,
|
||||||
filename,
|
|
||||||
actualViewportWidth: data.source?.actualViewportWidth,
|
actualViewportWidth: data.source?.actualViewportWidth,
|
||||||
requestedViewportWidth: data.source?.requestedViewportWidth
|
requestedViewportWidth: data.source?.requestedViewportWidth
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user