Combining two bookmarklets

Yesterday I discovered bookmarks and am completely in love. I wrote several to reduce the number of clicks for several common tasks on my favorite sites. What I would like to do now, if possible, is to combine the actions of these two bookmarklets into one single script / link. The current setting is as follows: Bookmark 1 (B1) performs an action (at URL 1) that loads the page (URL 2), when Bookmark 2 (B2) then enters the standard data set into the form and submits it.

I tried all kinds of options:

javascript: (function () {w = window.open (codeFromB1, 'CatchyPageTitle'); w.TryToWriteSomethingToTheTheNewWindowToPassAndCallFunctionB2;)} ();

But all my attempts at w.TryToWriteSomethingToTheTheWindow give errors of different types. My last attempt was to use something like:

Alerts (. W.document.getElementsByTagName ("form") length); which gives the invoice from the calling page for the first time, but the invoice from the new window for the second time is called ...

Anyway, this is my story for today.

So I am a lost soul in need of guidance. I have two script actions that take place on two different pages, which I would like to combine into one piece of code, which can be saved as a bookmark. I need someone to point me in the right direction so that I can understand how to β€œlink” two pages / scripts in order to create one effective Bookmark.

Thanks in advance for your help.


, Data Array(), , script, , , . B2 :

wdoc.forms [0] = #.t5.value;

t5 - / . , :

thisInput = 't'.concat(i);// = 5 for-loop wdoc.forms [0].thisInput.value = #;

- "thisInput" - undefined. /, :

document.forms [0].thisInput [I].value = #;

. ?

+3
2

URL 1 ( ) URL 2? , . , HTML5 - , , .

Greasemonkey, Firefox , , Greasemonkey. , , , . script , , document.location.href. window.name hack .

+1

, :

wdoc = w.document; (wdoc.location.href); (wdoc.location.href);

'undefined', url ( ) FROM . , - , .

, :

JavaScript: (() { = window.open(B1, "CatchyPageTitleThatDoesn'tAppear" ); SetTimeout ( "otherFunction();", 750);})(); otherFunction() { wdoc = w.document; thisDoc = ; wdoc.setVariablesInTheFormInTheNewWindow; wdoc.forms [0].submit();}

! Woohoo!

, . URL1, URL2. . , , , . , . :

tbody class= " " >  TR >  TD >  /TD >  td > img/ " > /td > td > img/" > /td > td > img/ " > /td > td > img/" > /td > td > img/" > td > td > img/ " > /td > td > img/" > /td > td > img/ " > /td > td > img/" > /td > td > img/ " > /td > td > img/" > td > /tr > tr >

th > /th > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > /tr > tr > th >

/th > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > td > #/td > /tr > /tbody >

, ( ?), -

uglyText = wdoc.getElementsByClass( " " ) [0].innerHTML;

, , . , - , . , 10 , - 11, .

, #s specific_text other_specific_text. , , , .

.

0

Source: https://habr.com/ru/post/1721431/


All Articles