Created
November 18, 2015 02:05
-
-
Save float1251/6128807843d4be21ab54 to your computer and use it in GitHub Desktop.
チャットワークの画像をスタンプ風に変換するchrome拡張機能
This file contains 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
// 画像の編集ボタンを押すと自動で編集して、送信する | |
(function(){ | |
if(location.host.search("www.chatwork.com") == -1){ | |
// 他サイトなので処理しない | |
return | |
} | |
// TODO ON,OFF出来るようにする | |
setInterval(function(){ | |
var textElem = document.getElementsByClassName("chatSendTextareaEdit"); | |
if(textElem.length == 0){ | |
return | |
} | |
var res = textElem[0].children[0].value.match((/\[preview id=\d* ht=\d*\]/)) | |
if(res.length != 0){ | |
// textを編集して、送信する | |
textElem[0].children[0].value = res[0].replace(/ht=\d*/, "ht=230"); | |
document.getElementById("_sendButton").click(); | |
} | |
}, 200) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment