使用bookmarklet提交表单/单击按钮

时间:2018-04-10 12:54:45

标签: javascript bookmarklet

如何添加到我的工作书签

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

提交此表格:



<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>
&#13;
&#13;
&#13;

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

尝试了

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

但两件对我都没有用。

0 个答案:

没有答案