kdzwinel / SnappySnippet

Chrome extension that allows easy extraction of CSS and HTML from selected element.
1.08k stars 162 forks source link

Fixed "Open in JsBin/JsFiddle", switched localstorage to chrome.storage.local #71

Open KartikSoneji opened 4 years ago

KartikSoneji commented 4 years ago

Fixes Issue #66 and Issue #50

Related: Issue #55 is fixed, so should be closed.

KartikSoneji commented 4 years ago

Also implemented Feature #60

kdzwinel commented 4 years ago

Thanks a lot! Much appreciated. I'm worried about that jsbin approach though - extacting _csrf token seems very fragile. Do you know if there is any working jsbin API? If not, how about we open https://jsbin.com/?html,css,output in a new tab and just automatically paste HTML and CSS into correct inputs? This approach could work for all jsbin/codepen/jsfiddle.

KartikSoneji commented 4 years ago

No, I could not find any API for JsBin, I have reverse-engineered the POST request from the JsBin page to get it to work.

JsFiddle and CodePen do have documented public APIs, and I think that it is better to use them. Opening https://jsbin.com/?html,css,output in a new tab and pasting HTML and CSS will be difficult, as it will involve transmitting data across tabs. I do not see how this can be done reliably.

The current solution may be fragile, but I do not see any other way of supporting JsBin.