greasemonkey

Disabling a page's focus-checking function using GM [duplicate]

穿精又带淫゛_ 提交于 2019-12-06 08:50:14
This question already has answers here : Stop execution of Javascript function (client side) or tweak it (4 answers) Closed 6 years ago . I'm trying to stop a page from stopping itself when it thinks it's lost focus. So How do I disabling a function within webpage using GM? I'll try by giving the script on the page, hopefully someone can help me decipher it better, LOL. <script> var nmn=0,isa=0,pr=1,wc=1,clkt='ptc',clki=303250,clkc=634089,capt=1367698325,stimg='http://something.com/img/',fxp=0,timer=30,tfrac=188,wmw=640,wmh=320,txbop='******************************\nThis website is attempting

Greasemonkey script in Firefox 4, want to change one line of code on webpage

寵の児 提交于 2019-12-06 07:30:36
Alright, I will try to make this is as simple as possible, without being too vague. I want to change one of line of code on a webpage in hopes of preventing a preview pane from appearing. Original line of code <div id="previewpane" class="previewpane" sytle="height: 139px;"> I want to replace the above line with <div id="previewpane" class="previewpane previewpane-hide" style="height:139px;"> I have previously written one Greasemonkey script but unfortunately I am have having difficulty applying the techniques learned from that script into this new one, thus this post. cheers -Chris That's

Scriptish script needs the page refreshed to run?

非 Y 不嫁゛ 提交于 2019-12-06 07:18:04
问题 This script assists in a checkout process at an online store. All is working correctly, except the need to refresh the page to get the program to run initially. I wonder if it is a cache problem because it works on other products that have been previously viewed. I also tried tinkering with the @run-at to no avail. I'm using the Scriptish extension and it is a standalone .js file. // ==UserScript== // @id proper-id // @name proper-name // @version 1.0 // @namespace // @description // @include

How can I create an object of a class which is defined in the remote page?

眉间皱痕 提交于 2019-12-06 06:39:45
问题 For example, in the remote webpage, there is a snippet of code like this: <script> function foo(){ this.bar = 0; } In my greasemonkey script, I want to create an object of this class: var _foo= unsafeWindow['foo']; new _foo(); Then I got an Illegal Value error. 回答1: Here's how to do it: var _foo = eval('(' + unsafeWindow.foo.toSource() + ')'); var x = new _foo(); This workaround may be required due to the different security zones or sandboxing that Greasemonkey does, though I'm not entirely

How to write a greasemonkey script to remove a confim dialog?

 ̄綄美尐妖づ 提交于 2019-12-06 06:38:01
问题 I wanted to write a very simple greasemonkey script because I hate the "are you sure?" javascript confirmation on a site I use a lot. I'm just going to use it for personal use, not going to publish it or anything. After some Googling I found http://wiki.greasespot.net/UnsafeWindow explaining what it seems that I want to do. The source code for the page I want is like this var message = "Are you sure?"; function confirmIt(message) { var result = confirm(message); return result; } I want to

Greasemonkey script to reload the page every minute

淺唱寂寞╮ 提交于 2019-12-06 06:08:17
How to reload a page every 60 seconds? My attempt: setTimeout (location.reload, 1 * 60 * 60); I'm not sure what those numbers mean, or how to adapt them to reload after 60 seconds only. setTimeout(function(){ location.reload(); }, 60*1000); You have to pass a full function as first argument, and second is the time in millisecond. So in your case, 60 * 1000 You may give a function name, since it is a callable, however, location.reload is a method of the location object. It is callable, but when it is executed by the timer, the this context will not be the location object. This fact leads to an

Help with hiding DIV tags, based on text content, using Greasemonkey

允我心安 提交于 2019-12-06 03:53:50
I am looking for a way to write a Greasemonkey script which will take the following snippet of code and only show the code blocks consisting of <div class="A" where both "passtest" and "State1" are present. <div class="A"> <div class="B"> <a href="/link1"> <img class="imgClass" src="http://link.com/img.img" title="imgTitle"/> </a> </div> <div class="C"> <span class="sc1">passtest</span> <br/> <em class="ec1">City1, State1</em> </div> </div> <div class="A"> <div class="B"> <a href="/link1"> <img class="imgClass" src="http://link.com/img.img" title="imgTitle"/> </a> </div> <div class="C"> <span

How do I use constructor of a remote Page to create an Object in my Greasemonkey UserScript?

╄→гoц情女王★ 提交于 2019-12-06 02:47:42
问题 The page on which my userscript will run has a namespace, the namespace defines a constructor function. I would like to create an object using the same constructor and use methods of the object in my userscript. So far I have been unsuccessful. Here's what I am trying to do. The Page has the following native javascript block : var namespace={ constructor : function(){ this.sum = function(value1,value2){ alert(value1+value2); } } } being used like: var pageObject=new namespace.constructor();

Call href from JavaScript

坚强是说给别人听的谎言 提交于 2019-12-05 21:01:38
问题 This is the same question as THIS ONE, I can't answer that anymore, so I'm re-posting it with my account. Sorry for the mess. I need a Greasemonkey script that on a page load activates a href link like 'javascript:FUNCTION'. I've seen this code: <script language="Javascript" type="text/javascript"> function somescript() { window.location.href = document.getElementById('ololo').href; } </script> <a href="javascript:alert('test');" id="ololo">test</a> <br /> <a href="javascript:somescript()"

Remove All onclick Events for an Element

纵饮孤独 提交于 2019-12-05 19:55:51
var links = document.body.querySelectorAll("p.sourcelinks a.individual_source_link"); for(var i=0;i<links.length;i++) { links[i].onclick = null; } Is my current code, however it doesn't remove the onclick events. I have no idea what they will be since this is a greasemonkey script. Your code only deals with events added by element.onclick case. What about events added with addEventListener (for standards compliant browsers) and attachEvent (for IE)? You need to use removeEventListener and detachEvent to remove events as well as setting .onclick to null. Then all your bases will be covered.