diff --git a/dist/botman.user.js b/dist/botman.user.js index f7899d8..85b5aa5 100644 --- a/dist/botman.user.js +++ b/dist/botman.user.js @@ -5,7 +5,7 @@ // @include https://www.facebook.com/* // @exclude https://www.facebook.com/ai.php* // @exclude https://www.facebook.com/xti.php* -// @version 1.1.4 +// @version 1.2.0 // @grant GM_xmlhttpRequest // @run-at document-end // ==/UserScript== @@ -95,6 +95,10 @@ function Message(ev){ that.send = function(body){ that.event.target.value = body; + + var ev = Keyfaker.keydown(Keyfaker.SPACE); + ev.botmanGenerated = true; + that.event.target.dispatchEvent(ev); } that.sendNow = function(body){ @@ -286,7 +290,11 @@ function serializeToUrlEncoded(obj){ if (!!images.responseData){ images = images.responseData.results; if (!!images && images.length > 0){ - msg.send(chooseRandom(images).unescapedUrl) + msg.send(chooseRandom(images).unescapedUrl + " "); + // Clear link after facebook share has parsed it + setTimeout(function(){ + msg.send(""); + }, 1000); // } } }, diff --git a/src/Main.js b/src/Main.js index 2379d02..579f6ce 100644 --- a/src/Main.js +++ b/src/Main.js @@ -5,7 +5,7 @@ // @include https://www.facebook.com/* // @exclude https://www.facebook.com/ai.php* // @exclude https://www.facebook.com/xti.php* -// @version 1.1.4 +// @version 1.2.0 // @grant GM_xmlhttpRequest // @run-at document-end // ==/UserScript== diff --git a/src/Message.js b/src/Message.js index bb054f1..9da05da 100644 --- a/src/Message.js +++ b/src/Message.js @@ -14,6 +14,10 @@ function Message(ev){ that.send = function(body){ that.event.target.value = body; + + var ev = Keyfaker.keydown(Keyfaker.SPACE); + ev.botmanGenerated = true; + that.event.target.dispatchEvent(ev); } that.sendNow = function(body){ diff --git a/src/scripts/google-images.js b/src/scripts/google-images.js index 9b1ed4a..33dcfed 100644 --- a/src/scripts/google-images.js +++ b/src/scripts/google-images.js @@ -27,7 +27,11 @@ if (!!images.responseData){ images = images.responseData.results; if (!!images && images.length > 0){ - msg.send(chooseRandom(images).unescapedUrl) + msg.send(chooseRandom(images).unescapedUrl + " "); + // Clear link after facebook share has parsed it + setTimeout(function(){ + msg.send(""); + }, 1000); // } } },