Created
August 16, 2020 00:56
-
-
Save cevhyruz/3167585333cec7ab065687a24a512100 to your computer and use it in GitHub Desktop.
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
// ==UserScript== | |
// @name Facebook Elements Grabber | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author You | |
// @match https://*.facebook.com/abestexpressph/inbox* | |
// @grant none | |
// ==/UserScript== | |
(function(window) { | |
let fb = { | |
name: document.getElementsByClassName('ellipsis'), | |
copyToClipboard: function(string) { | |
var el = document.createElement('textarea'); | |
el.value = string; | |
el.setAttribute('readonly', ''); | |
el.style = {position: 'absolute', left: '-9999px'}; | |
document.body.appendChild(el); | |
el.select(); | |
document.execCommand('copy'); | |
document.body.removeChild(el); | |
}, | |
focusTextarea: function() { | |
let textbox = document.getElementsByClassName('uiTextareaAutogrow')[0]; | |
textbox.style.border = 'solid 5px solid #ff0000 !important'; | |
textbox.focus(); | |
setTimeout ( textbox.style.border = '', 500); | |
}, | |
focusThread: function() { | |
document.getElementsByClassName('uiScrollableAreaContent')[0].focus(); | |
}, | |
getName: function(error) { | |
let sender_name = this.name[1].textContent; | |
if (sender_name != '') { | |
this.copyToClipboard(sender_name); | |
} | |
}, | |
foobar: function() { | |
alert('foobar'); | |
}, | |
testigo: function() { | |
alert('testigo'); | |
} | |
}; | |
window.fb = fb; | |
})(window); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment