Greasy Fork

Greasy Fork is available in English.

Bilibili 视频默认选择最高清晰度

try to take over the world!

目前为 2018-11-26 提交的版本。查看 最新版本

// ==UserScript==
// @name         Bilibili 视频默认选择最高清晰度
// @namespace    http://tampermonkey.net/
// @version      0.2018.11.30
// @description  try to take over the world!
// @author       You
// @match        *://www.bilibili.com/video/av*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    var MO = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
    new MO(function (element, observer) {
        setTimeout(function () {
            element = document.querySelector("div.bui-select-list-wrap li:first-child");
            if (element !== null && element.click() === 0) observer.disconnect();
        }, 500);
    }).observe(document.body,{'attributes': true});
})();