# excelimportor **Repository Path**: ladit/excelimportor ## Basic Information - **Project Name**: excelimportor - **Description**: No description available - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-04-13 - **Last Updated**: 2021-04-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 起因 老婆从事的是售后的工作,常年需要把售前工程师和销售的一些实施的数据录入到他们的工作平台上。 最开始我看在眼里,焦虑在心上,我心想,你这完全是人力无价值的搬运工的(excel到网页表单)工作,你们公司难道不能把录入这一部分的工作开放给更前线的人或者提供一个excel导入的工具吗?老婆摇摇头说,这个事已经提了n年了,以她这工作岗位在公司里的重要程度,还不足以让开发工程师紧着她做事,他们还有“更重要的事”要做。 曾几何时,开发出身的我也想着让她学学Js,Python什么的,可是对于她来说,学写程序和看剧这两件事情无疑看剧是```更重要的事```。 为了拯救老婆的双眼和布道计算机就是生产力,我抽起了老刀,咔咔咔,不辱使命。 ----- [不愿意用github的懒人看这里,收点税](https://download.csdn.net/download/flyback/12316927) [操作说明](https://jingyan.baidu.com/article/b7001fe14ed9bf4f7382dd33.html) [github源代码](https://github.com/kjflyback/excelimportor/tree/master) V0.0.5 修改了操作方式 ## 代码解析及原理 manifest.json 文件 ```JSON { "name": "ExcelImportor", "version": "0.0.3", "manifest_version": 2, "description": "excel 数据填入web表单", "browser_action":{ "default_popup":"assets/scripts/popup.html" }, "web_accessible_resources": [ "assets/scripts/preview.html", "assets/scripts/preview.js" ], "background": { "scripts": ["assets/libs/xlsx.core.min.js","assets/libs/jQuery/jquery.js","assets/scripts/background.js"], "persistent": true }, "content_scripts": [{ "matches": [""], "js": [ "assets/libs/jQuery/jquery.js", "assets/libs/xlsx.core.min.js", "assets/scripts/inject.js" ], "all_frames":true, "run_at":"document_end", "match_about_blank":true }], "permissions": [ "tabs", "" ] } ``` - browser_action - default_popup ```assets/scripts/popup.html``` 需要操作数据的弹出菜单页面,这个页面是可以和后台脚本进行直接调用的。 - web_accessible_resources 这里的页面和脚本是用来作为数据预览用的,只有加到这里才会可以被扩展访问到 - content_scripts - matches 的 `````` 让后面的```js```节点中的所有文件可以插入到浏览器加载的每一个页面,不会进行过滤,包括```