oschina侧边油猴脚本
在左右两边分别添加微博、osc的动弹页面的iframe,乱写着玩。
油猴使用
- 使用油猴创建新脚本并复制代码进去
- 油猴
- 支持:chrome,firefox
收藏夹使用
- 去掉最上面的注释
- 先压缩代码后在最前面添加
javascript:
后添加到chrome的收藏夹中 - 在需要使用的页面点击该收藏夹即可
代码
1// ==UserScript==
2// @name osc-sidebar
3// @namespace http://xu81.com/
4// @version 0.1
5// @description osc首页侧边栏,显示最新动弹和快速发送动弹的油猴插件
6// @author xu81.com
7// @match https://www.oschina.net/
8// @exclude https://www.oschina.net/tweet
9// @grant none
10// ==/UserScript==
11
12(function() {
13 'use strict';
14
15 var iframe = document.createElement('iframe');
16 iframe.style.cssText = 'width: 350px;height: 800px;position: absolute;right: 0px;border: none;top: 96px;z-index: 999;';
17 iframe.setAttribute('src', 'https://www.oschina.net/tweets');
18 document.body.appendChild(iframe);
19
20 var iframe_weibo = document.createElement('iframe');
21 iframe_weibo.style.cssText = 'width:350px;height:800px;position:absolute;left:0px;top: 96px; z-index:999;border:none;';
22 iframe_weibo.setAttribute('src','https://m.weibo.cn/');
23 document.body.appendChild(iframe_weibo);
24})();