-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmuckety.js
23 lines (20 loc) · 880 Bytes
/
muckety.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function mucketySearch(info, tab) {
chrome.tabs.create({"url" : "javascript:" + mucketyPostCode + " mucketyPost('" + info.selectionText + "');"});
}
chrome.contextMenus.create({"title": "Search Muckety for '%s'",
"contexts":["selection"],
"onclick": mucketySearch});
function mucketyPost(name) {
var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "http://muckety.com/Query");
var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", "name");
hiddenField.setAttribute("value", name);
form.appendChild(hiddenField);
document.body.appendChild(form);
form.submit();
};
//minify function
mucketyPostCode = mucketyPost.toString().replace(/(\n|\t)/gm,'');