您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
导入导出json到blob
当前为
- // ==UserScript==
- // @name Json2Blob
- // @namespace http://firefoxcn.net/
- // @description 导入导出json到blob
- // @version 0.1
- // @author Dniness
- // @match https://greasyfork.org/*
- // @grant none
- // @license GPL License
- // ==/UserScript==
- (function() {
- 'use strict';
- let e = document.getElementById("install-area");
- e&&fetch(e.firstElementChild).then(e=>e.text()).then(e=>{
- let div = document.getElementById("install-area");
- e = eval(e);
- let html = Object.keys(e);
- html.forEach(c=>{e[c]=JSON.stringify(e[c])});
- div.array = e ;
- e = div.fun = e =>{
- let x = div.array[e.options[e.selectedIndex].value];
- x = new Blob([x], {type: 'text/plain'});
- x = URL.createObjectURL(x);
- e.outerHTML = '<a href="'+x+'" target="_blank">右键复制</a>';
- }
- html.unshift('<select onChange="this.parentNode.fun(this)"><option style="display:none">存在数组引用');
- div.innerHTML+=html.join('</option><option>');
- }).catch(e=>console.log('not objects of json'));
- })();