您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
在必应首页右下角添加一个背景图片下载按钮
当前为
// ==UserScript== // @name Download Bing Background Image - bing.com // @name:zh-CN 必应首页背景图片下载 // @description Add download button to Bing homepage. // @description:zh-CN 在必应首页右下角添加一个背景图片下载按钮 // @namespace Violentmonkey Scripts // @match https://*.bing.com/ // @grant none // @version 0.6 // @author Alvin // @run-at document-idle // ==/UserScript== var parent = document.getElementById('sh_rdiv'); if (parent) { parent.innerHTML += '<a role="button" id="downBtn" title="Download image" aria-label="Download image" role="button" href="" h="ID=SERP,5054.1" style="cursor: pointer;"><div class="sc_light" style="visibility: visible;"><div id="sh_lt" class="hpcDown"></div></div></a>'; var btn = document.getElementById('downBtn'); btn.addEventListener('click', function() { var title = document.getElementById('sh_cp').title || (document.getElementById('musCardImageTitle').innerHTML + ' ' + document.getElementById('musCardCopyright').innerHTML); var bg = document.getElementById('bgDiv').style.backgroundImage; imgUrl = bg.slice(4, -1).replace(/"/g, ""); btn.href = imgUrl; btn.download = title + '.jpg' }, false); } else { var styleElem = document.head.appendChild(document.createElement("style")); styleElem.innerHTML = "#downBtn::after {display: none;} .footer {width: 96% !important; padding: 0 2% !important;}"; setTimeout(function () { var parentEl = document.getElementsByClassName('headline')[0]; var parent = document.createElement('div'); var el = parentEl.appendChild(parent); el.innerHTML = '<a role="button" id="downBtn" title="Download image" aria-label="Download image" role="button" href="#" style="cursor: pointer; width: 2.5rem; height: 2.5rem; position: relative;"><svg class="downloadIcon" x="0px" y="0px" viewBox="0 0 22 22" enable-background="new 0 0 22 22" aria-hidden="true" role="presentation"><path d="M17.842 11.483l-6.671 6.725-6.671-6.725.967-.967 5.017 5.049v-15.565h1.375v15.565l5.017-5.049.966.967zm-12.859 10.517v-1.375h12.375v1.375h-12.375z"></path></svg></a>'; var btn = document.getElementById('downBtn'); btn.addEventListener('click', function() { var title = document.getElementsByClassName('title')[0].innerText var copyright = document.getElementsByClassName('copyright')[0].innerText var bg = (document.getElementsByClassName('img_uhd')[0] || document.getElementsByClassName('img_cont')[0]).style.backgroundImage; imgUrl = bg.slice(4, -1).replace(/"/g, ""); btn.href = imgUrl; btn.download = title + ' ' + copyright + '.jpg' }, false); }, 1000) }
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址