updated bookmarklet code snippet

main
Lee Hanken 2022-01-18 19:59:07 +00:00
parent fd4d7c93e2
commit e7314efc76
1 changed files with 4 additions and 2 deletions

View File

@ -30,8 +30,10 @@ javascript:(
var request=new XMLHttpRequest();
var url="https://urltomarkdown.herokuapp.com/?url="+encodeURIComponent(location.href);
request.onreadystatechange=function() {
if(request.readyState==4&&request.status==200) {
location.href="simplenote://new?content="+encodeURIComponent(request.responseText);
if(request.readyState==4&&request.status==200) {
let text = '# ' + request.getResponseHeader('X-Title') + '\n' + request.responseText;
location.href="simplenote://new?content="+encodeURIComponent(text);
}
};
request.open("GET",url, true);