greasemonkey

IE9 HTTPS security is compromised by my Greasemonkey script?

荒凉一梦 提交于 2019-11-27 21:20:40
I’ve got a Greasemonkey-for-IE script in IE9 that’s importing jQuery. But on secure pages it doesn’t work. I’m getting: SEC7111: HTTPS security is compromised by http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js The code that fails is: var script = document.createElement("script"); script.setAttribute("src", "http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"); How can I make this work? The script doesn’t cause a problem in Firefox. Presumably: Use https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js instead (or not trust a third party CDN (to be both

How can I mimic Greasemonkey/Firefox's unsafeWindow functionality in Chrome?

会有一股神秘感。 提交于 2019-11-27 20:54:33
I'm just fiddling around with user scripts in chrome right now, so please bear with my potential ignorance/idiocy. In the page I'm writing a script for, there is a <script> element that declares a variable x . Does this mean that, in my user script, I can just access x from the global namespace? For example, if the only line in my userscript is alert(x); , should that work as expected (assuming x is a String)? I understand chrome doesn't support unsafewindow, but for some reason I'm finding it impossible to figure out how to mimic the functionality. Is it even possible? NVI contentWindow was

Run a Greasemonkey script only once per page load?

我的梦境 提交于 2019-11-27 20:32:17
If you create a Greasemonkey script with @include * and go to a site like youtube, it runs the script 20+ times every time you refresh. This is on Firefox, not sure about Chrome. Is there a way to prevent this? First, you probably don't want the script to run in iFrames. You can block that using the @noframes directive which now works in both Greasemonkey and Tampermonkey as of October, 2014. For older versions, or for script engines that don't support @noframes , you can use this code, just after the metadata block: if (window.top != window.self) //don't run on frames or iframes { //Optional:

My Greasemonkey script is not finding the elements (links) on the page?

时光怂恿深爱的人放手 提交于 2019-11-27 19:35:16
问题 The website is: lexin.nada.kth.se/lexin/#searchinfo=both,swe_gre,hej; My script is: function main(){ var links=document.getElementsByTagName("a"); alert("There are " + links.length + "links."); } main(); Running the script gives me two alert messages saying There are 0 links. Any ideas why I can't get the right amount of links from the document? And why do I get the alert twice? 回答1: The alert fires more than once because that page contains iFrames (with, de facto, the same URL as the main

Why is usage of the downloadURL & updateURL keys called unusual and how do they work?

≡放荡痞女 提交于 2019-11-27 19:04:00
I was reading GM's wiki to determine the difference between @downloadURL & @updateURL (which I didn't). But what confused me even more that both are unadvised: It is unusual to specify this value. Most scripts should omit it. I'm surprised by that as it's the only way for scripts to auto-update and I don't see why these keys shouldn't be used. The wiki itself is pretty lacking and no other forum sources are advised, so I have to ask here. Also would appreciate more detailed info on these keys. Brock Adams Use of those keys is discouraged mainly by Greasemonkey's lead developer. Most others,

How can I make a Greasemonkey script to auto-download a file? [duplicate]

拈花ヽ惹草 提交于 2019-11-27 18:41:34
问题 This question already has an answer here: Save images to hard disk WITHOUT prompt? 6 answers I go to the page, it has 1 zip file, but I don't know the name, other than its a .zip . I want Greasemonkey to download this zip automatically, maybe using flashgot or something? So I need it to activate on page load, then look for *.zip , and add that to downloads automatically. Any ideas? 回答1: Greasemonkey, by itself, cannot automatically save zip-files, or anything else, to the local file system.

How to Run a Greasemonkey Script only once

一世执手 提交于 2019-11-27 16:51:54
问题 I made a greasemonkey script for a domain, Now how do I make it run only once? Like it starts every time the domain is accessed, I don't want that. How do I make it run only once and then like delete itself or make itself inactive? Thanks. 回答1: If you want a script (or part of a script) to run only once, then you need to store a flag in non-volatile storage. A script cannot delete itself or turn itself off. But it can exit right away rather than run any other code. To store things on a site

Greasemonkey\JavaScript Copy to Clipboard button

China☆狼群 提交于 2019-11-27 16:50:36
问题 I am trying to write a JavaScript script to add to greasemonkey that adds a button after an element. The onClick for this button should copy the parents element text to the keyboard. I have seen plenty of examples that copy already selected text to the clipboard such as this: <SCRIPT LANGUAGE="JavaScript"> <!-- Begin function copyit(theField) { var selectedText = document.selection; if (selectedText.type == 'Text') { var newRange = selectedText.createRange(); theField.focus(); theField.value

Greasemonkey to change value of Radio buttons in a form?

孤街浪徒 提交于 2019-11-27 16:22:22
I am writing a Greasemonkey/Tampermonkey script and I need to turn on radio buttons depending on the name and value of the radio control. This is how it looks: <input type="radio" name="11" value="XXX" class="radio"> <input type="radio" name="11" value="zzzz" class="radio"> So I want to set those buttons that have name of 11 and a value of zzzz to be checked. Brock Adams This is super easy when you use jQuery. Here's a complete script: // ==UserScript== // @name _Radio button check // @include http://YOUR_SITE/YOUR_PATH/* // @require http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min

Clicking a button on a page using a Greasemonkey/userscript in Chrome

試著忘記壹切 提交于 2019-11-27 16:10:47
I'm going to be as absolutely verbose here as possible as I've run into a few solutions that didn't end up panning out. Please keep in mind that I don't know Javascript . I know basic HTML and CSS. I don't have any actual programming background but I'm trying to learn bit by bit by researching basic tasks like this. Please talk to me like I'm an idiot. Any lingo I throw around in this post I learned while researching this specific issue. I'm writing this userscript as a personal project and to share with some friends. What I'm trying to do. I'm trying to write a userscript for Chrome