FAQ Database Discussion Community


Conversion of JavaScript to userscript

javascript,jquery,jquery-ui,greasemonkey,userscripts
I have a JavaScript running making ajax calls to a server. <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script type="text/javascript"> var div = '<div id="OverlayDialog">'; $.Coral = function (options) { $.extend(options, { data: JSON.stringify(options.data), dataType: 'json', type: 'POST', async: false, contentType: 'application/json', processData: false, headers: { 'Content-Encoding': 'abc', 'Target': options.operation }, dataFilter: function(data,...

Greasemonkey - How do you find and open aν URL on a page that starts with a specific string?

javascript,greasemonkey
Updated I want to open a new window for each link on a page whose URL begins with a certain string. For example: http://stackoverflow.com/users/3763853/tonakis2108 I want it to open every link on the page that contains: http://stackoverflow.com/users On a new window or tab. The url after http://stackoverflow.com/users/"string" changes after a...

javascript on page load check if a span (under ) with a specific class exist, if does not exist remove the entire

javascript,html,browser,directory,greasemonkey
I am trying to create my own greasemonkey script for my favorite directory listing site :) The thing is not everything it list is beneficial to me, I inspected the website code and as it seems, each entry is under Now, and as it seems, I am only interested with...

javascript get href address and change

javascript,jquery,html,greasemonkey
i need to get href value and change it and open in new tab Automatically. Address tag in the page. <a href="http://xxxxx/first_123.html" id="view-1" class="view button_green" style="margin: 10px;">view</a> I want to get http://xxxxx/first_123.html address with JavaScript and Change to http://xxx/second_123.html And then Open http://xxx/first_123.html In new tab Automatically. I Use Greasemonkey....

Greasemonky: How to return count and value of specific div class?

javascript,greasemonkey
Lets say I have the following on a page: <div class="data-container">John</div> <div class="data-container">Dave</div> <div class="data-container">Bob</div> How can I use a javascript in greasemonkey to count each "data-container" class, extract the value (i.e. John) and display this info as a popup? like so: 1) John 2) Dave 3) Bob Here is...

Greasemonkey not working at all

javascript,jquery,firefox,greasemonkey
Greasemonkey: 2.3 Firefox: 33.0.3 Windows: 8 I am not entirely sure if this is the same code used from my other computer running Vista amongst versions of other things due to the death of it, but mostly. It doesn't seem to be working, even if I engineer to be...

Greasemonkey @grant does not work anymore?

firefox,greasemonkey
I have the following Greasemonkey script, which tries to read a resource text: // ==UserScript== // @name Test // @namespace test // @version 1 // @grant GM_getResourceText // @resource testresource http://stackoverflow.com/ // ==/UserScript== var text = GM_getResourceText('testresource'); I tried something like that a couple of weeks ago and it worked....

Allow multiple file upload in Greasemonkey

javascript,greasemonkey,tampermonkey
In a webpage there is an input field that allows a user to select a file to upload. The relevant code is <input id="fileupload" type="file" name="versionFile" style="position: absolute; left: -9999px;"> How would I use Greasemonkey/Tampermonkey to change the code to the following to allow multiple file uploads <input id="fileupload" type="file"...

jQuery in a Greasemonkey script – click event is not firing in Firefox? [duplicate]

javascript,jquery,firefox,greasemonkey
This question is an exact duplicate of: Adding a @grant value breaks my Greasemonkey+jQuery script? 1 answer Using a Greasemonkey script on a page that has jQuery 1.6.3, I'm trying to get a link to react to mouse clicks. Here are the interesting parts: // ==UserScript== // […] //...

How to set a persistent global timeout using a Tampermonkey/Greasemonkey script?

javascript,jquery,greasemonkey,tampermonkey
I am trying to redirect the tab to, say, http://google.com every few minutes, no matter what happened to the tab (it is still open of course). I am using: setTimeout(function() { window.location.href = "http://google.com"; }, 500000); However the counter refreshes as soon I load a new page in the tab....

Why isn't this function working on greasemonkey

javascript,greasemonkey
Why isn't this function working in greasemonkey. function arre(){ var index; var fruits = ["Banana", "Orange", "Apple", "Mango"]; for (index = 0; index < fruits.length; index++) { window.alert(fruits[index]); } } ...

GreaseMonkey, change some js functions

javascript,jquery,greasemonkey
I use Greasemonkey for some changes in pages. I have a web page that it have used SomeFunction() on it. SomeFunction() placed in a javascript file. I ignored the javascript file with some add-ons . But i need rewrite SomeFunction() by myself. But when i define SomeFunction() in my GM...

How to replace a javacript function (which is loaded -among other code- from a remote file) with my own implementation using Greasemonkey?

javascript,greasemonkey
There's a page eg. http://somesite.com that runs some javascript code located in path eg.http://somesite.com/code.js In that file -among other code- there's a function (badFunction(x,y)). I'd like to change the value of one of it's local variables, in order to make it equal with some another (local) variable (which is used...

Github redirect from sign-out to sign-in page instead of homepage

javascript,jquery,github,greasemonkey,userscripts
I would to redirect to sign-in page when sign-out instead of redirect to homepage in github. Any idea how I can do with an userscript? I would be grateful for assistance. Here is how the form snippet look: <ul> <li class="header-nav-item"> <form accept-charset="UTF-8" action="/logout" class="logout-form" method="post"> <div style="margin:0;padding:0;display:inline"> <input name="utf8"...

Is it possible to check whether a script of any version has been included?

javascript,jquery,scripting,include,greasemonkey
Earlier this day I wrote a small script for greasemonkey which fixes the sometimes buggy auto scroll in the StackOverflow Chat. I did // @require jquery......... however that lead to some problems since the chat is already using jQuery in a lower version which is not compatible with a newer...

How to hide certain elements using Greasemonkey?

javascript,greasemonkey,tampermonkey
I'm looking to hide certain elements using Greasemonkey. Links like this: <a href="earn-google-circles.php" target="_blank" );"="">View</a> Or images like this: <img src="http://www.somesite.org/img/icon/earn-google-circles-435912.png" alt="Circle" title="Google Circle" height="18px" width="50px"> Of course, it's a part of a larger Div, but that div can't be hidden because it would hide other things I don't want...

Greasemonkey: Unable to move div classes

javascript,html,greasemonkey,userscripts,twitch
I've been trying to use a personal grease/tampermonkey script for use on twitch.tv Currently I'm trying to move stats and stream-config-status to be above the dash-hostmode-contain. I found this post and tried re-working it to fit what I want. This is what I had setup http://jsfiddle.net/7L2s180s/3/ But I am pretty...

Autologin script won't work

greasemonkey,autologin,tampermonkey
I cannot get my autologin Tampermonkey script to work on a webpage. This is the source of the page: <p> <label for="username" style="opacity: 1;">Gebruikersnaam</label> <input type="text" name="username" id="username" autocomplete="off" autofocus=""> </p> <p> <label for="password">Wachtwoord</label> <input type="password" name="password" id="password" autocomplete="off"> </p> <button id="authLeftPaneLoginButton" class="smscButton"> Aanmelden </button> A translation for...

Run function after a function called in an interval?

javascript,jquery,greasemonkey
I'm making a Greasemonkey script and I found a problem. The website has a function run in an interval: jQuery(function1.run); setInterval(function1.run, function1.interval); and I would want to run my function right after function1.run interval is finished. I can't change anything in the website code, so I can rely only on...

Creating a firefox script to close all but one tab?

firefox,greasemonkey
im using greasemonkey in firefox and looking to create a script that will close all but a specified tab(or webpage). Ive little to no clue what im doing, i wanted it to be simple i.e. if (tabs >= 3) Close all tabs except specified webpage but i just cant seem...

How to execute a Greasemonkey script on every infinite scrolling event in a Twitter conversation?

javascript,twitter,greasemonkey
I'm trying to make a greasemonkey userscript that will work in Twitter conversations (colorize names,usernames and each 1st @reply). When a Twitter conversation has a lot of replies (example link), then opening such a link displays only 3 screenfuls of replies(the initial screenful+2 more) -at least in my 1920x1200 display-...

How can I play sound with a GreaseMonkey script in FireFox when there's a “Content Security Policy” error?

firefox,greasemonkey,content-security-policy
var audioPlayer = new Audio("http://URLTOMYSOUND/ping.mp3"); audioPlayer.play(); I get this error upon loading the audio: Content Security Policy: The page's settings blocked the loading of a resource at... How do I get around this? I don't care where the sound is, I just want to play it. It could be local,...

Script to modify a URL in greasemonkey

greasemonkey
I'm trying to change the following url: http://www.example.net/?image=full&action=view&imageid=1361 into http://www.anothersite.com/download&id=1361&thumb=0 while preserving the id (1361 in the example) (change 'example.net/?image=full&action=view&image' to 'anothersite.com/download&' and add '&thumb=0' at the end of the url) How do I write a GreaseMonkey script for that? ps. I've already googled it and copied the code below....

Append a new column, to each row, with text equivalent of the first column value?

javascript,jquery,html,greasemonkey
Note: I didn't create this table, I am an end-user trying to make my life easier. What I need to do is to copy this table to excel, but the first and second column are in input box style. I want to create a new column at the end of...