Greasy Fork

Greasy Fork is available in English.

华能电子商务平台宽屏显示

本脚本的唯一用处就是将华能电子商务平台适配成宽屏显示

当前为 2021-11-06 提交的版本,查看 最新版本

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         华能电子商务平台宽屏显示
// @namespace    http://tampermonkey.net/
// @version      0.2
// @description  本脚本的唯一用处就是将华能电子商务平台适配成宽屏显示
// @author       woung
// @match        http://ec.chng.com.cn/ecmall/*
// @icon         https://www.google.com/s2/favicons?domain=chng.com.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    console.log("测试油猴");
    document.body.innerHTML = document.body.innerHTML.replace(/华能能源交通产业控股有限公司集团公司物资供应中心/g, "[能交]");
    console.log(document.body.innerHTML)

    var style = document.createElement("style");
    style.type = "text/css";
 //   var text = document.createTextNode(".main_box2{ min-width:1300px; max-width:1300px; margin:0 auto; padding:0; position:relative;}"); /* 这里编写css代码 */
    var text = document.createTextNode(".main_box2{ min-width:1300px!important; max-width:1300px!important;width: 1300px!important;}"); /* 这里编写css代码 */
    style.appendChild(text);

    //text = document.createTextNode(".con_box2 .main_box2{width: 1300px!important;}"); /* 这里编写css代码 */
    //style.appendChild(text);

    var head = document.getElementsByTagName("head")[0];
    head.appendChild(style);

     $(".main_box").each(function (i, n) {
        $(this).addClass("main_box2");
        if($(this).hasClass("con_box")){
            $(this).attr("style","width: 1300px!important;");
        }
    })
   //main_box_right
    $(".main_box_right").each(function (i, n) {
        $(this).attr("style","width: 1080px!important;");

    })
   //main_r_con
    $(".main_r_con").each(function (i, n) {
        $(this).attr("style","width: 1080px!important;");
        //获取下面的li,修改宽度
        $(this).children().attr("style","width: 1080px!important;");


    })
    //选择 class为  f_l notice_a  的a链接,去掉属性
    $(".notice_a").each(function (i, n) {
        $(this).attr("style","max-width: 920px;");
    })
    // Your code here...
})();