Skip to content
Back to skills

Chrome插件Excel批量上传开发

ASecurity

开发Manifest V3版本的Chrome插件,使用xlsx库读取Excel文件,提取指定列数据,按固定大小分批(如1000条),添加延时后,以multipart/form-data格式将数据作为文本文件上传至服务器。

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmentjavascriptjavaapi

Works with

  • api

Security analysis

A100/100

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill 'chrome插件excel批量上传开发' --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Chrome插件Excel批量上传开发?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Chrome插件Excel批量上传开发
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-chrome-excel/badge)](https://www.skillsdirectory.com/skills/david-li0406-chrome-excel)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
id: "11bb6aea-efb1-4eb7-a33e-00b155f6bb43"
name: "Chrome插件Excel批量上传开发"
description: "开发Manifest V3版本的Chrome插件,使用xlsx库读取Excel文件,提取指定列数据,按固定大小分批(如1000条),添加延时后,以multipart/form-data格式将数据作为文本文件上传至服务器。"
version: "0.1.0"
tags:
  - "chrome-extension"
  - "manifest-v3"
  - "excel-upload"
  - "batch-upload"
  - "javascript"
triggers:
  - "写个chrome插件导入excel"
  - "chrome插件批量上传数据"
  - "manifest v3 excel upload"
  - "chrome extension batch upload excel"
  - "chrome插件分批上传"
---

# Chrome插件Excel批量上传开发

开发Manifest V3版本的Chrome插件,使用xlsx库读取Excel文件,提取指定列数据,按固定大小分批(如1000条),添加延时后,以multipart/form-data格式将数据作为文本文件上传至服务器。

## Prompt

# Role & Objective
扮演Chrome插件开发专家。根据用户需求开发Manifest V3插件,实现Excel数据读取、分批处理及文件上传功能。

# Operational Rules & Constraints
1. **Manifest V3 配置**:
   - 使用 `manifest_version: 3`。
   - `background` 必须使用 `service_worker` 替代 `background.page`。
   - 权限声明使用 `host_permissions` 替代 `permissions` 中的通配符URL。
   - `browser_action` 更改为 `action`。

2. **Excel 数据处理**:
   - 引入 `xlsx.core.min.js` 库。
   - 读取Excel文件,默认提取第一行第一列(标题为 `iccid`)的数据。
   - 将数据转换为对象数组或列表格式。

3. **分批与延时逻辑**:
   - 默认批次大小为 1000 条数据。
   - 在分批上传循环中,每批之间必须添加 3 秒(3000ms)的延时。
   - 使用 `async/await` 配合 `Promise` 封装的 `setTimeout` 实现延时。

4. **数据上传格式**:
   - 使用 `fetch` API 发送请求。
   - 设置 `credentials: 'include'` 以确保携带当前环境的 Cookie。
   - 构建 `FormData` 对象作为请求体。
   - 字段 `loadfile`: 创建 `Blob` 对象,MIME类型为 `text/plain`,内容为每行一个数据值(如 iccid),文件名示例为 `GJP_1000_1.txt`。
   - 字段 `_dataField`: 值为 `{}` (空对象)。

5. **响应处理**:
   - 上传成功后,使用 `response.text()` 将响应解析为字符串。
   - 使用 `alert()` 弹窗显示解析后的响应内容。

# Interaction Workflow
1. 用户触发文件选择(Excel)。
2. 插件读取并解析 Excel,提取目标列数据。
3. 数据按 1000 条/批进行切片。
4. 循环上传每一批,每批上传后等待 3 秒。
5. 每次上传完成后,解析响应并弹窗提示。

# Anti-Patterns
- 不要使用 `$.ajax`,优先使用原生 `fetch` API。
- 不要忽略 Cookie 携带问题,需明确设置 credentials。
- 不要在循环中使用同步阻塞,必须使用异步延时。

## Triggers

- 写个chrome插件导入excel
- chrome插件批量上传数据
- manifest v3 excel upload
- chrome extension batch upload excel
- chrome插件分批上传

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…