-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartpage.com.js
More file actions
98 lines (84 loc) · 2.79 KB
/
startpage.com.js
File metadata and controls
98 lines (84 loc) · 2.79 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// ==UserScript==
// @include https://startpage.com/*
// @name LOR correct pagePrev/Next
// @author Bga
// @version 0.1
// @description
// ==/UserScript==
opera.addEventListener('BeforeExternalScript', function(js) {
// opera.postError(js.element)
js.preventDefault()
}, false)
opera.addEventListener('BeforeScript', function(js) {
// opera.postError(js.element)
js.preventDefault()
}, false)
!(function(global) // opera.postError(js.element)
{
var waitCommon = function(fn) {
if(global.Bga && global.he) {
fn()
}
else {
setTimeout(function() {
waitCommon(fn)
}, 0)
}
}
waitCommon(function() {
with(Bga) {
setProtoExpando()
document.documentElement.removeInlineEvents()
var log = 1 ? logRaw : logNull
onDOMReady(function() {
var paramMap = parseQueryString(location.search.slice(1))
if(1) (function() {
try {
//# show all images in products listing
;document.getElementsByTagName("NOSCRIPT").each(function(noscript) {
// log(noscript.innerText)
noscript.replace(de("".concat(noscript.innerText)))
})
}
catch(err) {
if(!(err instanceof SkipError)) {
throw err
}
}
})()
//# search using GET
if(1) if(location.pathname.endsWith("/sp/search")) (function() {
var keepParamsMap = { "q": 1, "page": 1, "cat": 1 };
;([].slice.call(document.getElementsByTagName("FORM"))
.filter(function(v) {
return v.action.endsWith(location.pathname)
})
.each(function(search) {
search.setAttribute("method", "GET");
search.elements["query"].name = "q"
search.elements.each(function(v) {
if(v.type == "hidden" && keepParamsMap[v.name] == null) v.remove();
});
})
)
})()
//# hotkeys
if(1) (function() {
var createHotkey = function(category, hotkey, desc) {
document.body.appendChild(de("<a />").tap(function(x) {
x.href = "".concat(location.protocol, "//", location.host, location.pathname, "?", stringifyQueryString(Object.assign({ }, paramMap).tap(function(obj) {
delete(obj, "page");
obj["cat"] = category;
})));
x.accessKey = hotkey;
x.title = desc;
}));
};
createHotkey("web", "A", "All");
createHotkey("pics", "I", "Images");
createHotkey("video", "V", "Videos");
})();
})
}
})
})(this)