greasemonkey

How to use hidden iframe connect to the server in GreaseMonky

若如初见. 提交于 2020-01-06 05:28:04
问题 First,I created a hidden frame like this: var oHiddenFrame = null; if(oHiddenFrame == null){ oHiddenFrame = document.createElement("iframe"); oHiddenFrame.name = "hiddenFrame"; oHiddenFrame.id = "hiddenFrame"; oHiddenFrame.style.height = "0px"; oHiddenFrame.style.width = "0px"; oHiddenFrame.style.position = "absolute"; oHiddenFrame.style.visbility = "hidden"; document.body.appendChild(oHiddenFrame); } Then,I add a event to the button like this: var fnLocation = function(){ frames["hiddenFrame

Using waitForKeyElements, is it possible to prevent the key element from being displayed, and only display it after it's modified by my code?

夙愿已清 提交于 2020-01-06 02:40:07
问题 I have this userscript (written with a great help from Stack Overflow) for the site metal-archives.com . Its structure is like this: function appendColumn(...) { // code for appending column // code for making the table sortable } waitForKeyElements ("table", appendColumn); The script works okay except for a visual glitch/delay as you switch sub-tabs (tables). When switching, the extra (6th) column is initially shown as expected. But then, the table is displayed momentarily in its original

What is Greasemonkey/Tampermonkey doing to my jQuery object when I use GM_setValue?

萝らか妹 提交于 2020-01-05 09:14:02
问题 I'm trying to select DOM elements into a Tampermonkey variable using GM_setValue , for later injection on different pages. I've created an example where I can do this in normal jQuery using .clone() , but when I set it as a value in Tampermonkey, it changes the value of the saved variable. Here's an HTML page to test the script on: <!DOCTYPE html> <html><head> <script data-require="jquery@*" data-semver="3.0.0" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>

Button click doesn't work in Greasemonkey/Tampermonkey script. Already tried standard mouse events with waitForKeyElements()

女生的网名这么多〃 提交于 2020-01-05 09:05:21
问题 I'm trying to click the "Mehr Laden" Button on the URL http://www.sparhandy.de/handy-kaufen/ with Tampermonkey. The Button is located underneath the Smartphone pictures. Here is the script that I wrote so far: // ==UserScript== // @name SparhandyScript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author Nigel // @match http://www.sparhandy.de/handy-kaufen/ // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js //

Replace parts of a URL in Greasemonkey

∥☆過路亽.° 提交于 2020-01-05 04:05:41
问题 I'm trying to replace a part of url using a Greasemonkey script, but having hard time to achieve what I'm trying to do. Original Urls are like: http://x1.example.to/images/thumb/50/157/1571552600.jpg http://x2.example.to/images/thumb/50/120/1201859695.jpg http://x3.example.to/images/thumb/50/210/2109983330.jpg What I want to achieve is this: http://example.to/images/full/50/157/1571552600.jpg http://example.to/images/full/50/120/1201859695.jpg http://example.to/images/full/50/210/2109983330

Greasemonkey: XPath returns no results for .xhtml page

谁说胖子不能爱 提交于 2020-01-04 09:25:20
问题 When running on an xhtml page, xpath doesn't seem to return any results. var result = document.evaluate( "//a/img", document.body, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null ); For example returns an empty result set. What's the problem here, and how do I fix it? 回答1: xhtml elements are not in null namespace, so you have to pass a namespace resolver to the method: function resolver(prefix) { return prefix === 'x' ? 'http://www.w3.org/1999/xhtml' : null; } var result = document

document.getElementsByTagName(“a”) misses a link

你。 提交于 2020-01-04 01:55:33
问题 I was working on a script for Greasemonkey (FX7) trying to remove certain links and found out that for some reason one that was present in the source, not hidden or constructed by JS, didn't show up in the array that that function returns. If that one would have been constructed via JS upon running that page it wouldn't wonder me but it's sitting right behind another link that gets found. So has anyone an idea why this is happening and how I could work around it? var links = document

How to check for 403 and 404 errors when changing the url of a resource?

时光总嘲笑我的痴心妄想 提交于 2020-01-03 17:11:21
问题 I am making a userscript for the TamperMonkey Chrome extension (it is the same than making a userscript for GreaseMonkey). In my script, I am iterating over some document external resources (img, css, links, scripts) via document.getElementsByTagName() and I am changing their src or href attributes to another url. For the majority of cases, the new url is loading properly but in some cases, it ends on a 404 or 403 error from my proxy. Could you give me some pointers about how to handle (if

Add dynamic div-layers (overlay) with a Greasemonkey script?

 ̄綄美尐妖づ 提交于 2020-01-03 05:06:14
问题 I am new to this so please be kind (; I'm trying to use Greasemonkey to add div-layers and I just can't get it to work properly. My final goal is to let the user draw a window on the screen (or make two clicks) and everything but this area should kind of fade out (added dark div-layers). But, for now I just wanted to add a visible layer to every site. Here is my first try (which did not work at all) : var CSSNJE = '#Test_divnje {height:100px; width:100px; background-color:red; position

Add dynamic div-layers (overlay) with a Greasemonkey script?

给你一囗甜甜゛ 提交于 2020-01-03 05:06:08
问题 I am new to this so please be kind (; I'm trying to use Greasemonkey to add div-layers and I just can't get it to work properly. My final goal is to let the user draw a window on the screen (or make two clicks) and everything but this area should kind of fade out (added dark div-layers). But, for now I just wanted to add a visible layer to every site. Here is my first try (which did not work at all) : var CSSNJE = '#Test_divnje {height:100px; width:100px; background-color:red; position