greasemonkey

Why doesn't this script work with successive page clicks?

纵饮孤独 提交于 2019-12-04 18:12:27
I am currently using the following script in Tampermonkey in Google Chrome: // ==UserScript== // @name Youtube opt in Ads per channel // @namespace schippi // @include http://www.youtube.com/watch* // @version 1 // ==/UserScript== var u = window.location.href; if (u.search("user=") == -1) { var cont = document.getElementById("watch7-user-header").innerHTML; var user=cont.replace(/.+\/user\//i,'').replace(/\?(?:.|\s)*/m,''); window.location.href = u+"&user="+user; } It seems to work perfectly in Firefox with Greasemonkey but in Google Chrome, it seems that it only works on the first click on a

How to use keydown event in textarea?

丶灬走出姿态 提交于 2019-12-04 17:27:03
I am not very used to using javascript but I have gotten sick of manually repeating a tast at work. When I write in a discussion forum I need a quick short command, like Ctrl-Alt-z, to insert some text into a textarea object. I have already written a function that inserts the text at the text cursor insertAtCursor(text). The ID of the textarea is "content". I know how to solve the problem of checking for key combinations. The problem I have is basically to check for any keyboard input at all. I have tried the following: document.keydown(function(event){ alert("Test"); }); However, it does not

How to implement “DOM Ready” event in a GreaseMonkey script?

∥☆過路亽.° 提交于 2019-12-04 16:45:18
问题 I'm trying to modify my GreaseMonkey script from firing on window.onload to window.DOMContentLoaded, but this event never fires. I'm using FireFox 2.0.0.16 / GreaseMonkey 0.8.20080609 This is the full script that I'm trying to modify, changing: window.addEventListener ("load", doStuff, false); to window.addEventListener ("DOMContentLoaded", doStuff, false); 回答1: So I googled greasemonkey dom ready and the first result seemed to say that the greasemonkey script is actually running at "DOM

inspect javascript calls for gmail's buttons

元气小坏坏 提交于 2019-12-04 16:31:54
i'm working on a greasemonkey script for gmail in which it'd be very useful to know what function call is made when the "send" button is clicked. (i was unable to find this using firebug, but am relatively new to javascript debugging.) it seems that one should be able to detect this, i just don't know what tool(s) to use. thanks very much for any help. p.s. ultimately the goal here is to be able to extract a unique message i.d. for outgoing gmail messages, which i figured would be present in this javascript call -- so if there's an alternate way to do this, that would work just as well. Gmail

How can I prevent a webpage from detecting I am running a script?

♀尐吖头ヾ 提交于 2019-12-04 16:26:09
After experimenting with scripts on facebook.com, I noticed that for a couple of minutes it didn't allow me to connect to facebook.com. This happened more than one time so I suspect that Facebook doesn't like to mess with their code using userscripts. The Stack Overflow question Can a website know if I am running a userscript? answers the multiple ways a website can detect scripts. Now I want to know how I can fool a website to not detect any scripts I may be running. Is there a way to know what my userscript HTML changes trigger on the website? Brock Adams For Firefox and Chrome there is no

How to replace @media (max-width) using Stylish or Greasemonkey?

余生颓废 提交于 2019-12-04 16:11:59
I'm having a problem viewing this website on my desktop browser. They have a responsive/fluid design that shows a mobile menu button instead of a horizontal nav-bar when the browser width is less than 990px. Since I'm using Firefox with 125% zoom, my desktop browser is less than 990px effective width. I looked into the CSS code and found the line. How can I use Stylish, Greasemonkey, or some other way to automatically replace the max-width value of "990px" with "800px"? @media (max-width:990px) { ... } I'm using Firefox 23 on Windows 7. Edit: Based on comments so far, I need to replace their

How do I include a remote javascript file in a Greasemonkey script?

痴心易碎 提交于 2019-12-04 15:37:13
问题 I'm trying to write a Greasemonkey script, and would like to use the jQuery library to do so, but I'm not quite sure how I would include jQuery from a web address to get rolling. How would I include jQuery (from Google's web server) into the greasemonkey script so that I can just go: $(document).ready(function(){ // Greasemonkey stuff here }); I'd prefer to get it from this source: <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript" charset=

Capture keypress in Javascript (Google Docs)

自闭症网瘾萝莉.ら 提交于 2019-12-04 14:11:31
I'm trying to write a little greasemonkey script/bookmarklet/what have you for Google Docs. The functionality I'd like to add needs a keypress/keyup/keydown event handler (one of those three). Unfortunately, Javascript isn't my forté, and I can't seem to capture (?) a keypress event to while in the edit pane. As a last resort, I've tried the following: javascript:(function(){ els = document.getElementsByTagName("*"); for(i=0;i<els.length;i++){ els[i].onkeypress=function(){alert("hello!");}; els[i].onkeyup=function(){alert("hello2!");}; els[i].onkeydown=function(){alert("hello3!");}; } })();

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

落爺英雄遲暮 提交于 2019-12-04 13:52:45
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 replace confirmIt(message) with just return true; So I made a script var oldFunction = unsafeWindow

Scriptish script needs the page refreshed to run?

若如初见. 提交于 2019-12-04 13:44:53
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 proper-url-here // @include about:blank // @run-at window-load // ==/UserScript== for (var i=0; i