Greasy Fork

Greasy Fork is available in English.

在 bing dict 中显示 有道 的结果

自用脚本

当前为 2022-03-14 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         在 bing dict 中显示 有道 的结果
// @namespace    http://tampermonkey.net/
// @version      0.32
// @license      MIT
// @description  自用脚本
// @author       庶民player
// @match        *.bing.com/dict*
// @icon         https://cn.bing.com/sa/simg/favicon-2x.ico
// @require      https://cdn.staticfile.org/jquery/3.3.1/jquery.min.js
// @run-at       document-idle
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var wd = "none"
    var qry = window.location.search.substring(1);
    var vals = qry.split('&');
    for(var i in vals){
        var pair = vals[i].split('=');
        if(pair[0] == "q") wd = pair[1];
    }
    if(wd.length > 50) return;

    var margin = parseInt((window.innerWidth -640-534) * 0.333333);
    $(".lf_area").css("position", "absolute");
    $(".lf_area").css("left", parseInt(margin)+"px");
    $("#b_footer").css("display", "none");

    $(".sidebar").children(".ads_dwn").css("display", "none");
    $(".sidebar").children(".dm_div").css("display", "none");

    let m = '<div style="overflow:hidden;position:absolute;right:'
        +parseInt(margin*0.5)
        +'px;top:120px;width:640px;">'
        +' <iframe src="https://dict.youdao.com/w/'
        + wd
        +'" frameborder=0 scrolling="no" width="760px" height="'
        +$(document).height()+
        'px" style="position:relative;top:-250px"'
        +'> </iframe> </div>'
    $(m).prependTo(".sidebar")
})();

    //var bingWidth = window.innerWidth - 640 - 60;
    //$(".sidebar").css("position", "absolute");//$(".sidebar").css("left", bingWidth + "px");//$(".sidebar").css("top", "80px");