-
Notifications
You must be signed in to change notification settings - Fork 0
/
openClosedVines2.user.js
40 lines (37 loc) · 1.13 KB
/
openClosedVines2.user.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// ==UserScript==
// @name Auto open sensitive Vines
// @namespace http://nindogo.tumblr.com/
// @version 0.1.0.5
// @description open vines that are hidden due to sensitivity.
// @match https://vine.co/*
// @downloadURL https://github.com/nindogo/test_repo/raw/master/openClosedVines2.user.js
// @require https://github.com/nindogo/test_repo/raw/master/mutation-summary.js
// @run-at document-end
// @copyright 2014+, Nindogo
// ==/UserScript==
var observer = new MutationSummary({
callback: openVines,
queries: [{
element: 'button.small',
elementAttributes: "button.small" // optional
}]
});
function openVines(summay) {
console.log(summay[0].added);
openVines2(summay[0].added);
}
function openVines2(u) {
var i, x;
//x = document.getElementsByClassName("small");
x=u;
console.log(x.length);
for (i = (x.length - 1); i > -1; i--) {
console.log(i);
console.log(x[i]);
try {
x[i].click();
} catch (error) {
console.log("during " + i + " I caught error: " + error.type + " with message: " + error.message);
}
}
}