Clean WeTransfer With Bing Background

Get the Bing Background image on WeTransfer

目前為 2023-12-14 提交的版本,檢視 最新版本

// ==UserScript==
// @name        Clean WeTransfer With Bing Background
// @namespace   WT
// @description Get the Bing Background image on WeTransfer
// @include     *wetransfer.com/*
// @include     *we.tl/*
// @version     1.6.2
// @author      SioGabx / PXL Carpets
// @grant       GM_xmlhttpRequest
// @icon        https://i.ibb.co/pntBGWq/we.png
// @connect     *bing.com
// @license MIT
// ==/UserScript==

//PXL Carpets original code : https://gf.qytechs.cn/fr/scripts/30158-wetransfer
function WeTransfer(css) {
    let head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    let style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css;
    head.appendChild(style);
}
var r = document.querySelector(':root');

function GetImageURL(ans) {
    var suffix = ans.images[0].url
    r.style.setProperty('--background-sio-fix', 'url("http://bing.com/' + suffix + '"');
}
function getImage(){
    GM_xmlhttpRequest({
        method: "GET",
        url: "https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1",
        headers: {
            "Content-Type": "application/json"
        },
        onload: function(response) {
            var ans = JSON.parse(response.responseText);
            GetImageURL(ans);
        }
    });
}
getImage();
WeTransfer(
    'body {background: #000 !important;}'
    +
    '.wallpaper, .nav__label {pointer-events: none !important; opacity: .8 !important;}'
    +
    '#wallpaper-container * {display: none;}'
    +
    '#wallpaper-container {background-image:var(--background-sio-fix);background-size: cover;}'
);

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址