tools.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. let toolMap = {
  2. 'json-format': {
  3. name: 'JSON美化工具',
  4. tips: '页面自动检测并格式化、手动格式化、乱码解码、排序、BigInt、编辑、下载、皮肤定制等',
  5. contentScriptJs: true,
  6. contentScriptCss: true,
  7. systemInstalled: true,
  8. menuConfig: [{
  9. icon: '⒥',
  10. text: 'JSON格式化',
  11. contexts: ['page', 'selection', 'editable']
  12. }]
  13. },
  14. 'json-diff': {
  15. name: 'JSON比对工具',
  16. tips: '支持两个JSON内容的自动键值比较,并高亮显示差异点,同时也能判断JSON是否合法',
  17. menuConfig: [{
  18. icon: '☷',
  19. text: 'JSON比对器'
  20. }]
  21. },
  22. 'qr-code': {
  23. name: '二维码/解码',
  24. tips: '支持自定义颜色和icon的二维码生成器,并且支持多种模式的二维码解码,包括截图后粘贴解码',
  25. contentScriptJs: true,
  26. menuConfig: [{
  27. icon: '▣',
  28. text: '二维码生成器',
  29. contexts: ['page', 'selection', 'editable', 'link', 'image']
  30. }, {
  31. icon: '◈',
  32. text: '二维码解码器',
  33. contexts: ['image']
  34. }]
  35. },
  36. 'image-base64': {
  37. name: '图片转Base64',
  38. tips: '支持多种模式的图片转Base64格式,比如链接粘贴/截图粘贴等,也支持Base64数据逆转图片',
  39. menuConfig: [{
  40. icon: '▤',
  41. text: '图片与base64',
  42. contexts: ['image']
  43. }]
  44. },
  45. 'en-decode': {
  46. name: '信息编码转换',
  47. tips: '支持多格式的信息编解码,如Unicode、UTF-8、UTF-16、URL、Base64、MD5、Hex、Gzip等',
  48. menuConfig: [{
  49. icon: '♨',
  50. text: '字符串编解码',
  51. contexts: ['page', 'selection', 'editable']
  52. }]
  53. },
  54. 'code-beautify': {
  55. name: '代码美化工具',
  56. tips: '支持多语言的代码美化,包括 Javascript、CSS、HTML、XML、SQL,且会陆续支持更多格式',
  57. contentScriptJs: true,
  58. contentScriptCss: true,
  59. menuConfig: [{
  60. icon: '✡',
  61. text: '代码美化工具',
  62. contexts: ['page', 'selection', 'editable']
  63. }]
  64. },
  65. 'code-compress': {
  66. name: '代码压缩工具',
  67. tips: 'Web开发用,提供简单的代码压缩功能,支持HTML、Javascript、CSS代码压缩',
  68. menuConfig: [{
  69. icon: '♯',
  70. text: '代码压缩工具'
  71. }]
  72. },
  73. 'aiagent': {
  74. name: 'AI(智能助手)',
  75. tips: '由AI强力支撑的超智能对话工具,可以让它帮你写代码、改代码、做方案设计、查资料、做分析等',
  76. menuConfig: [{
  77. icon: '֍',
  78. text: 'AI(智能助手)'
  79. }]
  80. },
  81. 'timestamp': {
  82. name: '时间(戳)转换',
  83. tips: '本地化时间与时间戳之间的相互转换,支持秒/毫秒、支持世界时区切换、各时区时钟展示等',
  84. menuConfig: [{
  85. icon: '♖',
  86. text: '时间(戳)转换'
  87. }]
  88. },
  89. 'password': {
  90. name: '随机密码生成',
  91. tips: '将各种字符进行随机组合生成密码,可以由数字、大小写字母、特殊符号组成,支持指定长度',
  92. menuConfig: [{
  93. icon: '♆',
  94. text: '随机密码生成'
  95. }]
  96. },
  97. 'sticky-notes': {
  98. name: '我的便签笔记',
  99. tips: '方便快捷的浏览器便签笔记工具,支持创建目录对笔记进行分类管理,笔记支持一键导出/导入',
  100. menuConfig: [{
  101. icon: '✐',
  102. text: '我的便签笔记'
  103. }]
  104. },
  105. 'html2markdown': {
  106. name: 'Markdown转换',
  107. tips: 'Markdown编写/预览工具,支持HTML片段直接转Markdown,支持将内容以PDF格式进行下载',
  108. menuConfig: [{
  109. icon: 'ⓜ',
  110. text: 'markown工具'
  111. }]
  112. },
  113. 'postman': {
  114. name: '简易Postman',
  115. tips: '开发过程中的接口调试工具,支持GET/POST/HEAD请求方式,且支持JSON内容自动格式化',
  116. menuConfig: [{
  117. icon: '☯',
  118. text: '简易Postman'
  119. }]
  120. },
  121. 'websocket': {
  122. name: 'Websocket工具',
  123. tips: '支持对Websocket接口的抓包测试,包括ws服务的连接测试、消息发送测试、结果分析等',
  124. menuConfig: [{
  125. icon: 'ⓦ',
  126. text: 'Websocket工具'
  127. }]
  128. },
  129. 'regexp': {
  130. name: '正则公式速查',
  131. tips: '支持 JavaScript / Python / PHP / Java 等语言的正则速查,包含验证类、提取类、替换类、格式化类、特殊字符类、编程相关等常用正则表达式',
  132. menuConfig: [{
  133. icon: '✙',
  134. text: '正则公式速查'
  135. }]
  136. },
  137. 'trans-radix': {
  138. name: '进制转换工具',
  139. tips: '支持2进制到36进制数据之间的任意转换,比如:10进制转2进制,8进制转16进制,等等',
  140. menuConfig: [{
  141. icon: '❖',
  142. text: '进制转换工具'
  143. }]
  144. },
  145. 'trans-color': {
  146. name: '颜色转换工具',
  147. tips: '支持HEX颜色到RGB格式的互转,比如HEX颜色「#43ad7f」转RGB后为「rgb(67, 173, 127)」',
  148. menuConfig: [{
  149. icon: '▶',
  150. text: '颜色转换工具'
  151. }]
  152. },
  153. 'crontab': {
  154. name: 'Crontab工具',
  155. tips: '一个简易的Crontab生成工具,支持随机生成Demo,编辑过程中,分时日月周会高亮提示',
  156. menuConfig: [{
  157. icon: '½',
  158. text: 'Crontab工具'
  159. }]
  160. },
  161. 'loan-rate': {
  162. name: '贷(还)款利率',
  163. tips: '贷款或还款利率的计算器,按月呈现还款计划;并支持按还款额反推贷款实际利率',
  164. menuConfig: [{
  165. icon: '$',
  166. text: '贷(还)款利率'
  167. }]
  168. },
  169. 'devtools': {
  170. name: 'FH开发者工具',
  171. tips: '以开发平台的思想,FeHelper支持用户进行本地开发,将自己的插件功能集成进FH工具市场',
  172. menuConfig: [{
  173. icon: '㉿',
  174. text: 'FH开发者工具'
  175. }]
  176. },
  177. 'page-monkey': {
  178. name: '网页油猴工具',
  179. tips: '自行配置页面匹配规则、编写Hack脚本,实现网页Hack,如页面自动刷新、自动抢票等',
  180. contentScriptJs: true,
  181. menuConfig: [{
  182. icon: '♀',
  183. text: '网页油猴工具'
  184. }]
  185. },
  186. 'screenshot': {
  187. name: '网页截屏工具',
  188. tips: '可对任意网页进行截屏,支持可视区域截屏、全网页滚动截屏,最终结果可预览后再保存',
  189. contentScriptJs: true,
  190. noPage: true,
  191. menuConfig: [{
  192. icon: '✂',
  193. text: '网页截屏工具'
  194. }]
  195. },
  196. 'mock-data': {
  197. name: '数据Mock工具',
  198. tips: '快速生成各种测试数据,支持个人信息、商业数据、技术数据等多种类型,可自定义字段和输出格式',
  199. menuConfig: [{
  200. icon: '⟡',
  201. text: '数据Mock工具'
  202. }]
  203. },
  204. 'color-picker': {
  205. name: '页面取色工具',
  206. tips: '可直接在网页上针对任意元素进行色值采集,将光标移动到需要取色的位置,单击确定即可',
  207. contentScriptJs: true,
  208. noPage: true,
  209. menuConfig: [{
  210. icon: '✑',
  211. text: '页面取色工具'
  212. }]
  213. },
  214. 'naotu': {
  215. name: '便捷思维导图',
  216. tips: '轻量便捷,随想随用,支持自动保存、本地数据存储、批量数据导入导出、图片格式下载等',
  217. menuConfig: [{
  218. icon: 'Ψ',
  219. text: '便捷思维导图'
  220. }]
  221. },
  222. 'grid-ruler': {
  223. name: '网页栅格标尺',
  224. tips: 'Web开发用,横竖两把尺子,以10px为单位,用以检测&校准当前网页的栅格对齐率',
  225. contentScriptJs: true,
  226. contentScriptCss: true,
  227. noPage: true,
  228. menuConfig: [{
  229. icon: 'Ⅲ',
  230. text: '网页栅格标尺'
  231. }]
  232. },
  233. 'page-timing': {
  234. name: '网站性能优化',
  235. tips: '全面分析网页性能指标,包括核心Web指标(LCP/FID/CLS)、资源加载性能、内存使用、长任务监控等,并提供针对性的优化建议',
  236. contentScriptJs: true,
  237. noPage: true,
  238. menuConfig: [{
  239. icon: 'Σ',
  240. text: '网站性能优化'
  241. }]
  242. },
  243. 'excel2json': {
  244. name: 'Excel转JSON',
  245. tips: '将Excel或CVS中的数据,直接转换成为结构化数据,如JSON、XML、MySQL、PHP等(By @hpng)',
  246. menuConfig: [{
  247. icon: 'Ⓗ',
  248. text: 'Excel转JSON'
  249. }]
  250. },
  251. 'chart-maker': {
  252. name: '图表制作工具',
  253. tips: '快速制作各类数据可视化图表,支持柱状图、折线图、饼图等多种图表类型,可导出为图片格式',
  254. menuConfig: [{
  255. icon: '📊',
  256. text: '图表制作工具'
  257. }]
  258. },
  259. 'svg-converter': {
  260. name: 'SVG转为图片',
  261. tips: '支持SVG文件转换为PNG、JPG、WEBP等格式,可自定义输出尺寸,支持文件拖放和URL导入',
  262. menuConfig: [{
  263. icon: '⇲',
  264. text: 'SVG转图片工具'
  265. }]
  266. },
  267. 'poster-maker': {
  268. name: '海报快速生成',
  269. tips: '快速创建营销推广海报,支持朋友圈、小红书等多种模板,可自定义文字、图片和配色',
  270. menuConfig: [{
  271. icon: '🖼️',
  272. text: '海报快速生成'
  273. }]
  274. },
  275. 'datetime-calc': {
  276. name: '时间戳计算器',
  277. tips: '支持多种时间格式解析、批量转换、时区转换、数据库格式生成等高级时间处理功能',
  278. menuConfig: [{
  279. icon: '⏱️',
  280. text: '时间戳计算器',
  281. contexts: ['page', 'selection', 'editable']
  282. }]
  283. }
  284. };
  285. // 判断是否为Firefox浏览器,如果是则移除特定工具
  286. if (navigator.userAgent.indexOf('Firefox') !== -1) {
  287. delete toolMap['color-picker'];
  288. delete toolMap['postman'];
  289. delete toolMap['devtools'];
  290. delete toolMap['websocket'];
  291. delete toolMap['page-timing'];
  292. delete toolMap['grid-ruler'];
  293. delete toolMap['naotu'];
  294. delete toolMap['screenshot'];
  295. delete toolMap['page-monkey'];
  296. delete toolMap['excel2json'];
  297. }
  298. export default toolMap;