I am looking for a quick way to capture some data from one web page and throw it into another. I do not have access to the query string in the URL of the second page, so transferring data this way is not an option. Right now, I'm using a Greasemonkey script user in tandem with a JS booklet trigger:javascript:doIt();
if (document.location.host.match(internal_site)) {
var datum1 = GM_getValue("d1");
var datum2 = GM_getValue("d2");
}
unsafeWindow.doIt = function() {
if(document.location.host.match(public_site)) {
var d1 = innerHTML of page element 1;
var d2 = innerHTML of page element 2;
window.setTimeout(function() {GM_setValue("d1", d1);}, 0);
window.setTimeout(function() {GM_setValue("d2", d2);}, 0);
}
else if(document.location.host.match(internal_site)) {
document.getElementById("field1").value = datum1;
document.getElementById("field2").value = datum2;
}
}
Although I am open to another method, I would prefer to stay with this basic model, if possible, as this is just a small part of the code in doIt()that is used on several other pages, mainly for automating date-filling forms; people really like their magic button.
, : , , , . , , GM cookie , , . , GM_getValue() clicklet-clicktime, . !