Expand publishing and virtual product workflows

This commit is contained in:
王鹏
2026-09-30 11:00:01 +08:00
parent 4ed8743934
commit b904dcf52e
54 changed files with 2185 additions and 108 deletions

View File

@@ -0,0 +1,45 @@
(() => {
const config = {
platform: 'douyin',
platformName: '抖音',
preserveContentLineBreaks: true,
useAtomicHtmlLineBreaks: true,
looseContentVerification: true,
videoModeLabels: [],
imageModeLabels: [],
uploadSelectors: [
'input[type="file"][accept*="video"]',
'input[type="file"]'
],
videoInputSelectors: ['input[type="file"][accept*="video"]'],
imageInputSelectors: [],
coverInputSelectors: [
'[class*="cover"] input[type="file"][accept*="image"]',
'[class*="poster"] input[type="file"][accept*="image"]'
],
titleSelectors: [
'input[placeholder*="标题"]',
'textarea[placeholder*="标题"]',
'[class*="title"] input'
],
contentSelectors: [
'[contenteditable="true"][data-placeholder*="作品描述"]',
'[contenteditable="true"][data-placeholder*="描述"]',
'textarea[placeholder*="作品描述"]',
'textarea[placeholder*="描述"]',
'[class*="editor"] [contenteditable="true"]'
],
progressSelectors: ['[class*="progress"]', '[role="progressbar"]'],
successTexts: [/^发布成功[!!。]?$/, /^作品发布成功[!!。]?$/],
failureTexts: [/^发布失败/, /^作品发布失败/]
}
chrome.runtime.onMessage.addListener(message => {
if (message && message.type === 'RUN_PUBLISH') {
globalThis.YidaimaPublisher.run(config, message.payload)
} else if (message && message.type === 'WATCH_PUBLISH_OUTCOME') {
globalThis.YidaimaPublisher.watch(config, message.payload)
}
})
chrome.runtime.sendMessage({ type: 'PLATFORM_READY', platform: config.platform })
})()