-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPadlockAutoFormSubmit.user.js
51 lines (44 loc) · 1.46 KB
/
PadlockAutoFormSubmit.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
41
42
43
44
45
46
47
48
49
50
51
// ==UserScript==
// @name Padlock Device Revoker (All Browsers)
// @namespace *
// @version 1.0
// @description Automatically revokes all devices in the padlock dashboard.
// @author John Elizarraras
// @include https://*
// @include http://*
// @grant none
// ==/UserScript==
// BROKEN
(function() {
'use strict';
//if title is padlock
if (document.title.toLowerCase().indexOf("padlock") === -1) return;
//fi title is padlock
//if sheets contain dashboard
var close = true;
var sheets = document.styleSheets;
for (var x = 0, len = sheets.length; x < len; x++) {
if (sheets[x].href && sheets[x].href.toLowerCase().indexOf("dashboard")!==-1) {
close = false;
}
}
if (close) return;
//fi sheets contain dashboard
// if pairing
var parameters = location.search.substring(1).split("&");
if (parameters.length === 0) return;
var name = unescape(parameters[0].split("=")[0]).toLowerCase();
if (name == "paired") return;
// fi pairing
// if reset
var parameters = location.search.substring(1).split("&");
if (parameters.length === 0) return;
var name = unescape(parameters[0].split("=")[0]).toLowerCase();
if (name == "datareset") return;
// fi reset
// location.replace("?datareset=1"); doesn't work
var forms = document.forms;
for(var n = 0, len = forms.length; n < len; n++){
forms[n].submit();
}
})();