扇贝听力自动展开

自动点击覆盖单词

当前为 2018-04-09 提交的版本,查看 最新版本

// ==UserScript==
// @name         扇贝听力自动展开
// @namespace    none
// @version      0.1
// @description  自动点击覆盖单词
// @author       You
// @match        https://www.shanbay.com/listen/sentence/
// @grant        none
// ==/UserScript==

function exp() {
    items = document.querySelector('#test-or-preview > div.row-fluid.sentence-content.hide > div > p').children;
    for(var i=0;i<items.length;i++){
        items[i].click();
    }
};

var click_btn = document.createElement('li');
var click_a = document.createElement('a');
click_a.innerText="展开所有";
click_a.onclick = function(){exp();};
click_btn.appendChild(click_a);
var ul = document.querySelector('#main-navbar > div.sub-menu.active > ul');
ul.appendChild(click_btn);