forked from dodying/UserJs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhvSaveImage.user.js
30 lines (30 loc) · 893 Bytes
/
hvSaveImage.user.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
/* eslint-env browser */
// ==UserScript==
// @name [HV]SaveImage
// @author dodying
// @include http*://hentaiverse.org/*
// @include http://alt.hentaiverse.org/*
// @version 1.10
// @grant GM_xmlhttpRequest
// @require https://cdnjs.cloudflare.com/ajax/libs/FileSaver.js/1.3.8/FileSaver.min.js
// @run-at document-idle
// ==/UserScript==
(function () {
if (document.getElementById('riddlecounter')) {
const url = document.querySelector('#riddlebot>img').src;
GM_xmlhttpRequest({
method: 'GET',
url,
responseType: 'arraybuffer',
headers: {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
},
onload(e) {
/* global saveAs */
saveAs(new window.Blob([e.response], {
type: 'image/jpeg',
}), `${new Date().getTime()}.jpg`);
},
});
}
}());