greasemonkey

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

巧了我就是萌 提交于 2019-11-26 18:36:18
问题 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

How can I detect AJAX node insertion without using DOM mutation events?

╄→гoц情女王★ 提交于 2019-11-26 18:35:20
问题 I'm trying to write a Greasemonkey script that alters keywords in Twitter posts. Trouble is, the content is "late loading" and is added to at the users request. If I were adding event listeners to the added elements, I could use JQuery's delegate() . As I simply want to change the content when it loads, this doesn't appear to be appropriate. Mutation Events seem to fit the bill. They are Gecko specific, but this doesn't matter much for a Greasemonkey script. Problem is, they have been

jQuery-UI is not working in my userscript without CSS, or with customization?

 ̄綄美尐妖づ 提交于 2019-11-26 17:51:58
I only want to use a tiny part of jQuery-UI (Menus) in a userscript I am making. jQuery-UI offers custom downloads, but I cannot find any links to specific modules, that I can @require in the script. Does anyone host the individual modules? Also, I have tried just requiring code.jquery.com/ui/1.11.1/jquery-ui.js , and the script crashes. Do I need to include some CSS with it as well? And also do some messy looking changes, like according to this answer ? Will that code be different for different JQUI versions? If I am only using a small part of the UI, does that change what I can safely delete

How to alter this javascript with Greasemonkey?

折月煮酒 提交于 2019-11-26 17:50:05
问题 Here is the script: <script type="text/javascript"> // <![CDATA[ $(document).ready(function() { $('#file_upload').uploadify({ 'uploader' : '/uploadify/uploadify.swf', 'script' : '/upload2.php', 'cancelImg' : '/uploadify/cancel.png', 'folder' : '/uploads', 'auto' : false, 'onError' : function (event,ID,fileObj,errorObj) { alert(errorObj.type + ' Error: ' + errorObj.info); }, 'fileExt' : '*.wma;*.mp3', 'fileDesc' : 'Audio Files', 'scriptData' : {'fileID':'20541','hash':

Save images to hard disk WITHOUT prompt?

依然范特西╮ 提交于 2019-11-26 16:42:16
I use twitter. Some people's tweets contain photos and I want to save them. I checked ifttt, where twitter is not a trigger. Thus, ifttt cannot help me do it. One idea is probably to use JavaScript. I use Firefox and installed Greasemonkey. I can write a Greasemonkey script (JavaScript) running on twitter website. Once I click "retweet" link or other button added by my script, my script examines the content of the tweet, find the URL of the photo, and save it to my disk. One problem is how to save the image. I searched the Internet. Some use win.document.execCommand("SaveAs") , and it will

Storing user login/password input in a Greasemonkey script on install

只愿长相守 提交于 2019-11-26 16:35:17
I'm doing a Greasemonkey script that communicates with the Redmine ticket manager through the REST API. As the user needs to login to get the data from Redmine, I need a way to ask the user for his credentials at script installation and save them to the script. Can this be achieved without asking the user to edit the values directly in the script itself? EDIT: Since there is already an answer to this question I will validate the answer given just below as it is a very good framework. Here is a framework for getting and storing login credentials. † The script prompts for the information on the

How to use greasemonkey to selectively remove content from a website

守給你的承諾、 提交于 2019-11-26 15:27:19
The content I am trying to modify has a series of <div> entries, and within each of these are other <div> entries. There are no id tags to help here. What I want the script to do is inspect the content of each of these <div> entries and look for some text. This will be used to determine whether the whole '' entry is deleted/hidden or not. Is this possible? How? Below is an example. There are several of these in the page, and I want to delete/hide the ones where the text inside the <div class="foo bar"> tags say "Yes." So in this example, this whole thing would get deleted/hidden. <div class=

Removing an anonymous event listener

喜欢而已 提交于 2019-11-26 15:22:43
Is there anyway to remove an event listener added like this: element.addEventListener(event, function(){/* do work here */}, false); Without replacing the element? There is no way to cleanly remove an event handler unless you stored a reference to the event handler at creation. I will generally add these to the main object on that page, then you can iterate and cleanly dispose of them when done with that object. You could remove the event listener like this: element.addEventListener("click", function clicked() { element.removeEventListener("click", clicked, false); }, false); Tiny Giant

Injecting JS functions into the page from a Greasemonkey script on Chrome

99封情书 提交于 2019-11-26 15:09:27
I have a Greasemonkey script that works just fine in Firefox and Opera. I struggle with getting it to work in Chrome, however. The problem is injecting a function into the page that can be invoked by code from the page. Here's what I'm doing so far: First, I get a helper reference to the unsafeWindow for Firefox. This allows me to have the same code for FF and Opera (and Chrome, I thought). var uw = (this.unsafeWindow) ? this.unsafeWindow : window; Next, I inject a function into the page. It's really just a very thin wrapper that does nothing but invoking the corresponding function in the

How to use XMLHttpRequest to download an HTML page in the background and extract a text element from it?

╄→尐↘猪︶ㄣ 提交于 2019-11-26 14:50:04
问题 I want to make a Greasemonkey script that, while you are in URL_1, the script parses the whole HTML web page of URL_2 in the background in order to extract a text element from it. To be specific, I want to download the whole page's HTML code (a Rotten Tomatoes page) in the background and store it in a variable and then use getElementsByClassName[0] in order to extract the text I want from the element with class name "critic_consensus". I've found this in MDN: HTML in XMLHttpRequest so, I