您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
修复微博图片在第三方网站上无法正常显示的问题
当前为
// ==UserScript== // @name 修复微博图片跨域展示 // @namespace https://github.com/itorr/fix-sinaimg.user.js // @version 0.11 // @description 修复微博图片在第三方网站上无法正常显示的问题 // @author itorr // @license MIT // @match *://*/* // @exclude *://weibo.com/* // @exclude *://*.weibo.com/* // @exclude *://t.cn/* // @icon https://weibo.com/favicon.ico // @run-at document-end // @grant GM_xmlhttpRequest // @supportURL https://github.com/itorr/fix-sinaimg.user.js/issues // ==/UserScript== const isSinaImageRegex = /sinaimg\.cn\//; const fixSinaImages = ()=>{ [...document.images].filter(el=>isSinaImageRegex.test(el.src)).forEach(el=>{ GM_xmlhttpRequest({ method:'GET', url: el.src, responseType: 'blob', headers: { 'referer': 'https://weibo.com/mygroups' }, onload(res){ el.src = URL.createObjectURL(res.response); } }); el.removeAttribute('src'); }); }; if(window.MutationObserver){ (new MutationObserver(fixSinaImages)).observe(document.body,{ childList: true, subtree: true, attributes: true, }); }else{ document.addEventListener('DOMNodeInserted',fixSinaImages); } window.addEventListener('load',fixSinaImages);