Created
June 24, 2015 02:40
-
-
Save karlgroves/1d73f80f2a0dcc78f82f to your computer and use it in GitHub Desktop.
*Super* rudimentary bookmarklet for testing document source with Tenon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var html=document.documentElement.innerHTML;var loaded=0;var iframe=document.createElement('iframe');iframe.name='bookmarklet-'+Math.floor((Math.random()*10000)+1);iframe.style.display='none';iframe.onload=function(){if(++loaded==1){return}document.body.removeChild(iframe)};var form=document.createElement('form');form.method="POST";form.action="https://tenon.io/api/";form.target=iframe.name;var hidden=document.createElement('input');hidden.type='hidden';hidden.name='key';hidden.value='ADD_YOUR_API_KEY_HERE';var store=document.createElement('input');store.type='hidden';store.name='store';store.value='1';var textarea=document.createElement('textarea');textarea.name='src';textarea.value=html;form.appendChild(hidden);form.appendChild(store);form.appendChild(textarea);iframe.appendChild(form);document.body.appendChild(iframe);form.submit()})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this successfully you'll need to replace the string 'ADD_YOUR_API_KEY_HERE' with your API key that you can get over at https://tenon.io/register.php