jsactions はてな用

hatena_quote.js

quote 用

 CopyTitleAndURL();
 
 function CopyTitleAndURL()
 {
     const EOL = "\r\n";
 
     var docTitle = window.content.document.title;
     var docURL = window.content.document.URL;
	 var docQuote = document.getSelection();
     _jsaCScript.setClipBoardString('>' + docURL + '>' + EOL + docQuote + EOL + '<<');

 }

hatena_img.js

photo 用

 CopyImgAndURL();
 
 function CopyImgAndURL()
 {
	const EOL = "\r\n";
 
	var imgObj = _jsaCScript.context.target;
	if(imgObj.localName != "IMG") return;

    var docTitle = window.content.document.title;
    var docURL = window.content.document.URL;
	var imgURL = imgObj.src;
    _jsaCScript.setClipBoardString('>' + docURL + '>' + EOL + '[' + imgURL +':image]' + EOL + '<<');

 }