81 lines
2.8 KiB
JavaScript
81 lines
2.8 KiB
JavaScript
|
|
(() => {
|
|||
|
|
const config = {
|
|||
|
|
platform: 'xianyu',
|
|||
|
|
platformName: '闲鱼',
|
|||
|
|
fillAfterUploadSettled: true,
|
|||
|
|
fillBeforeUpload: true,
|
|||
|
|
refillAfterUpload: true,
|
|||
|
|
fillDelay: 500,
|
|||
|
|
uploadSettleTimeout: 30000,
|
|||
|
|
fallbackContentToTitle: true,
|
|||
|
|
allowNoAssets: true,
|
|||
|
|
continueAfterCategoryFailure: true,
|
|||
|
|
videoModeLabels: [],
|
|||
|
|
imageModeLabels: [],
|
|||
|
|
prepareClickSteps: [],
|
|||
|
|
prepareTextChoices: ['Bug修改次数', '1-5天', '元/次'],
|
|||
|
|
blockingNotice: {
|
|||
|
|
messageText: '高级版已过期',
|
|||
|
|
dismissText: '再想想'
|
|||
|
|
},
|
|||
|
|
category: {
|
|||
|
|
historySelectors: ['.release-history'],
|
|||
|
|
inputSelectors: [
|
|||
|
|
'.channelCat input[placeholder="请输入关键词"]',
|
|||
|
|
'.channelCat input',
|
|||
|
|
'input[placeholder="请输入关键词"]'
|
|||
|
|
],
|
|||
|
|
optionSelectors: [
|
|||
|
|
'.el-cascader-node__label',
|
|||
|
|
'.el-popper [role="menuitem"]',
|
|||
|
|
'.el-popper li',
|
|||
|
|
'.custom-cascader [class*="item"]'
|
|||
|
|
],
|
|||
|
|
searchResultSelectors: [
|
|||
|
|
'[role="option"]',
|
|||
|
|
'.el-select-dropdown__item',
|
|||
|
|
'.el-cascader__suggestion-item',
|
|||
|
|
'[class*="cascader"] [class*="suggest"]',
|
|||
|
|
'[class*="category"] [class*="item"]'
|
|||
|
|
],
|
|||
|
|
resultText: '家居/服务/IT技术/软件/程序/网站开发',
|
|||
|
|
allowGlobalTextOption: true,
|
|||
|
|
optionTimeout: 1800,
|
|||
|
|
path: ['家居', '服务', 'IT技术', '软件', '程序', '网站开发']
|
|||
|
|
},
|
|||
|
|
uploadSelectors: [
|
|||
|
|
'input[type="file"][accept*="image"]',
|
|||
|
|
'input[type="file"][multiple]',
|
|||
|
|
'input[type="file"]'
|
|||
|
|
],
|
|||
|
|
videoInputSelectors: [],
|
|||
|
|
imageInputSelectors: [
|
|||
|
|
'input[type="file"][accept*="image"]',
|
|||
|
|
'input[type="file"][multiple]'
|
|||
|
|
],
|
|||
|
|
coverInputSelectors: [],
|
|||
|
|
titleSelectors: [
|
|||
|
|
'input[placeholder="请输入商品标题,最多允许输入30个汉字"]',
|
|||
|
|
'input[placeholder*="商品标题"]',
|
|||
|
|
'input[maxlength="30"]'
|
|||
|
|
],
|
|||
|
|
contentSelectors: [
|
|||
|
|
'textarea[placeholder="请输入商品描述"]',
|
|||
|
|
'textarea[placeholder*="商品描述"]',
|
|||
|
|
'[contenteditable="true"][data-placeholder*="商品描述"]'
|
|||
|
|
],
|
|||
|
|
progressSelectors: ['[class*="progress"]', '.el-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 })
|
|||
|
|
})()
|