您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Save GameFAQs as textfile.
当前为
- // ==UserScript==
- // @name Save GameFAQs as textfile
- // @description Save GameFAQs as textfile.
- // @namespace undefined
- // @include https://www.gamefaqs.com/*
- // @version 0.1
- // @grant none
- // ==/UserScript==
- (function () {
- var doc = document,
- text = doc.getElementById('faqtext').innerHTML,
- blob,
- a = doc.createElement('a'),
- filename = doc.URL.substr(doc.URL.lastIndexOf('/') + 1) + '.txt',
- p = doc.getElementsByTagName('p'),
- p2 = p[p.length - 3];
- if (text) {
- text = text.replace(/<\/?span.*?>/g, '');
- blob = new Blob([text], {
- endings: 'native'
- });
- a.href = URL.createObjectURL(blob);
- a.download = filename;
- a.textContent = 'Download Textfile';
- p2.appendChild(doc.createElement('br'));
- p2.appendChild(a);
- // doc.body.appendChild(a);
- }
- }) ();