0

How can i add to my working bookmarklet

javascript:void(window.open(%27https://developers.facebook.com/tools/debug/sharing/?q=%27+window.location.href,%27_blank%27));

the submitting of this form:

<form rel="async" action="/tools/debug/sharing_rescrape/?elem_id=u_0_0" method="post" onsubmit="return window.Event &amp;&amp; Event.__inlineSubmit &amp;&amp; Event.__inlineSubmit(this,event)" id="u_0_6">
<input type="hidden" name="fb_dtsg" value="AQH1ok_IYCTG:AQGqk6oXVqIV" autocomplete="off"><input type="hidden" autocomplete="off" name="url" value="http://example.com">
This URL hasn't been shared on Facebook before.
<button value="1" class="_42ft _4jy0 _3-9a _4jy3 _517h _51sy" type="submit">Fetch new information</button>
<span class="img _55ym _55yn _55yo _5tqs" aria-busy="true" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuetext="Loading..."></span>
</form>

I tried it with javascript:void(window.open(%27https://developers.facebook.com/tools/debug/sharing/?q=%27+window.location.href,%27_blank%27);document.getElementsByTagName('button')[0].click(););

and with

javascript:void(window.open(%27https://developers.facebook.com/tools/debug/sharing/?q=%27+window.location.href,%27_blank%27);document.forms[0].submit(););

but both weren't work for me.

Evgeniy
  • 2,337
  • 2
  • 28
  • 68
  • Check out [this question](https://stackoverflow.com/questions/49078807/js-a-method-to-set-cookie-then-load-page) and comments there. I think it's only possible to solve your issue by means of some extra tool, for example: 'iMacros' add-on. Or do you have any reasons not to use it? – Shugar Apr 11 '18 at 17:16
  • @Shugar i would like to use the code as bookmarklet and/or as javascript in a browser extension - iMacros dependency would make this much more complicated. – Evgeniy Apr 12 '18 at 08:42
  • I'm very unsure that a bookmarklet will help you. Also, take at look at [this question](https://stackoverflow.com/questions/49523946/open-url-in-same-tab-and-document-write-after) and the answer for reference too. – Shugar Apr 12 '18 at 12:53
  • @Shugar i fear, i understand. Do you see a way to accomplish it without third tool, just with js, maybe like jQuery? Or, how could it work in a browser extension? – Evgeniy Apr 12 '18 at 16:07
  • I would definitely use the free 'iMacros' add-on (and most probably its **Event** mode feature) because am not familiar with extension development. It's doubtful enough that third party JS libraries can do such job. – Shugar Apr 14 '18 at 14:27

0 Answers0