因为公司不让装云笔记的客户端,平时在公司都用网页版有道云笔记,每次打开发现左下角的广告位把菜单位压缩得很厉害,撸个脚本弄它。

脚本内容非常简单:
// 删除广告位
$('.sidebar-ft').remove();
// 设置菜单栏底部
$('.sidebar-content.widget-scroller').attr('style', 'bottom: 10px');
基于这个脚本,可以弄书签,也可以写成油猴脚本。
书签
添加一个书签,内容如下:
javascript: $('.sidebar-ft').remove(); $('.sidebar-content.widget-scroller').attr('style', 'bottom: 10px');

每次点一下这个书签即可。
油猴脚本
相对于书签每次需要自己点击,油猴脚本就简单多了,每次打开页面就能自动执行,无需人工介入。
脚本如下:
// ==UserScript==
// @name 有道云笔记删除广告位
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author https://www.jianshu.com/u/0039ed781cc6
// @match https://note.youdao.com/web/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
window.onload = function() {
console.info('页面加载成功');
// 删除广告位
//document.getElementsByClassName('sidebar-ft')[0].remove();
$('.sidebar-ft').remove();
// 设置菜单栏底部
//document.getElementsByClassName('sidebar-content widget-scroller')[0].setAttribute('style', 'bottom: 10px');
$('.sidebar-content.widget-scroller').attr('style', 'bottom: 10px');
console.info('广告位删除成功');
}
})();
网友评论