恢复被Chrome 77隐藏的www子域名

沙雕Google在Chrome 69时便尝试将www子域名隐藏,被网友骂了一顿之后撤回了操作。但是自Chrome 76开始,Google又将www子域名隐藏,同时还隐藏了https协议显示(仅保留锁头)。

在Chrome 76中,重新开启被隐藏的www子域名只需要将Flags里

chrome://flags/#omnibox-ui-hide-steady-state-url-scheme

选项设置为Disabled即可

而在Chrome 77中,Google又增加了一个选项

chrome://flags/#omnibox-ui-hide-steady-state-url-trivial-subdomains

将其设置为Disabled,再重载Chrome,熟悉的www子域名就又回来了

清空新浪微博

// 1. 使用 chrome 打开 weibo.com (确保你登录了微博)
// 2. 打开调试窗口,在 console 中贴下面的代码后回车
// 3. 如需删除其他微博,请输入一下内容后回车:start(); 

let mids = [];
let midIndex = 0;
let timer = null;
let running = false;
let http = new XMLHttpRequest();

function cleanNextPage() {
    let url = 'https://weibo.com/p/100505' + $CONFIG['uid'] + '/home';
    http.open('GET', url, true);
    http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
    http.send();
    http.onreadystatechange = function() {
        if (http.readyState != 4 || http.status != 200) {
            return;
        }

        let matches = http.responseText.match(/mid=([0-9]+)/g);
        if (matches == null) {
            stop('恭喜你,可以重新来过了。如果还有请再执行一遍 ');
            return;
        }
        
        let values = {};
        matches.forEach(function(match) {
            values[match.substr(4)] = 0;
        }, this);

        mids = Object.keys(values);
        timer = setInterval('deleteNextWeibo();', 1000);

        console.log('本页有 ' + mids.length + ' 条微博');
    }
}

function deleteNextWeibo() {
    if (midIndex >= mids.length) {
        mids = [];
        midIndex = 0;
        clearInterval(timer);
        setTimeout('cleanNextPage();', 1000);
        return;
    }

    deleteWeibo(mids[midIndex]);
    midIndex++;
}

function deleteWeibo(mid) {
    http.open('POST', 'https://weibo.com/aj/mblog/del?ajwvr=6', true);
    http.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
    http.send('mid=' + mid);
    http.onreadystatechange = function() {
        if (http.readyState != 4 || http.status != 200) {
            return;
        }

        let json = {}
        try {
            json = JSON.parse(http.responseText);
        } catch (error) {
            return;
        }

        if (json.code == 100000) {
            console.log('删除成功 - ' + mid);
        }
    }
}

function stop(message) {
    clearInterval(timer);
    running = false;
    console.log(message);
}

function start() {
    if (running) {
        console.log('进行中...');
        return;
    }

    console.log('开始删除');
    running = true;
    mids = [];
    midIndex = 0;
    cleanNextPage();
}

js文件源文件: https://raw.githubusercontent.com/pythias/weibo-start-over/master/weibo-start-over.js

1, 使用 chrome 打开 https://weibo.com 并登录 (https)
2, 打开调试窗口,复制 weibo-start-over.js 中的全部代码, 在 console 中粘贴代码后回车
3, 请在console输入 start()