-
Notifications
You must be signed in to change notification settings - Fork 0
/
Common Images finder.js
43 lines (39 loc) · 1.87 KB
/
Common Images finder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// ==UserScript==
// @name Common Images finder
// @namespace https://github.com/erfanva/
// @version 0.15
// @description try to take over the world!
// @author erfanva
// @match *://*/*
// @grant none
// @updateURL https://github.com/erfanva/Tools/raw/master/Common%20Images%20finder.js
// ==/UserScript==
(function() {
'use strict';
var image = document.querySelector('[property="og:image"]')
if(image && image.content) {
document.querySelector('body').innerHTML = "<input id='jhvasdhjvvjh' value='"+'[property="og:image"]'+"'><img src="+image.content+">" + document.querySelector('body').innerHTML
} else {
image = document.querySelector('[name="twitter:image"]')
if(image && image.content) {
document.querySelector('body').innerHTML = "<input id='jhvasdhjvvjh' value='"+'[name="twitter:image"]'+"'><img src="+image.content+">" + document.querySelector('body').innerHTML
} else {
image = document.querySelector('[name="og:image"]')
if(image && image.content) {
document.querySelector('body').innerHTML = "<input id='jhvasdhjvvjh' value='"+'[name="twitter:image"]'+"'><img src="+image.content+">" + document.querySelector('body').innerHTML
}else {
image = document.querySelector('.img-responsive-news')
if(image && image.src) {
document.querySelector('body').innerHTML = "<input id='jhvasdhjvvjh' value='"+'.img-responsive-news'+"'><img src="+image.src+">" + document.querySelector('body').innerHTML
}
}
}
}
if(image && (image.content || image.src)) {
console.log(image)
var copyText = document.getElementById("jhvasdhjvvjh");
/* Select the text field */
copyText.select();
document.execCommand("copy");
}
})();