扇贝听力、一键展开

一键展开覆盖单词

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         扇贝听力、一键展开
// @namespace    none
// @version      0.2
// @description  一键展开覆盖单词
// @author       You
// @match        https://www.shanbay.com/listen/*
// @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);