greasemonkey

Remove <b> tag from text

旧时模样 提交于 2019-12-14 02:47:06
问题 I want to make a bold text non-bold using Greasemonkey. I have only found ways to remove the tag along with its text, but not a way to simply remove the tag itself. So how do I make <b> some text </b> just some text ? 回答1: Assuming you've only one TextNode inside each B tag. b.parentNode.replaceChild(b.firstChild, b); Example : http://jsfiddle.net/DGTh5/ 回答2: Assuming you're dealing with elements, not a string: function unwrapChildren(element) { var parent, node, nextNode; parent = element

Trying to submit a form with GreaseMonkey, but the page stops working

安稳与你 提交于 2019-12-14 02:33:03
问题 I need to submit a form on a specific page, and it needs to click a radio button before it submits the form. I got everything working, however when I let GreaseMonkey submit the form the page just returns a white page. As where if I would click Submit manually, it says 'Wait a second please..' and then goes on to another page. If neccessary I can give you the URL of the form I am talking about. This is the script I am using: $(document).ready(function() { $("input[pmmethod=paypal]").click();

how to auto trigger my greasemonkey script every time i open a page

不问归期 提交于 2019-12-13 23:13:36
问题 this is my greasemonkey script. I want to auto-trigger it every time I open a reddit page. I want function up_vote_all() { vote_all('arrow up'); } to trigger on every page automatically without me click on the menu item. thanks // ==UserScript== // @name Reddit Mass Vote // @namespace http://reddit.com // @description You can up vote or down vote all comments on any page instantly without having to click each arrow. This is mainly to be used against spammers and trolls. // @include http://www

How to change a browsed page's <input>?

折月煮酒 提交于 2019-12-13 19:49:10
问题 I'm jQuery beginner. I'm trying to modify the source code of a page I'm browsing, using Firefox plus Greasemonkey. How can I modify: <input id="HiddenCategory" type="hidden" name="PageCategory"></input> to: <input id="HiddenCategory" type="text" name="PageCategory" value="OTHER"></input> ? 回答1: Something like this? $("#HiddenCategory").attr("type", "text").val("OTHER"); This is untested but i think it should work ok. 来源: https://stackoverflow.com/questions/19085007/how-to-change-a-browsed

Detecting Gmail attachment downloads

依然范特西╮ 提交于 2019-12-13 18:56:30
问题 Is there a way to detect if a particular file that is being downloaded is a Gmail attachment? I am looking for a way to write a Greasemonkey script which would help me organize the downloads, based on their download sources, say Gmail email attachments would have a different behavior from other stuff. So far, I've found out that attachments redirect to https://mail-attachment.googleusercontent.com/attachment/u/0/ , which I guess is not sufficient. EDIT Since an add-on would be more powerful

XPath, in a Greasemonkey script, is not selecting right nodes on an XHTML page

我们两清 提交于 2019-12-13 14:54:38
问题 I'm working on a Greasemonkey script for weibo.com . I can't pick the elements using XPath on the XHTML page. This code fails to grab the elements I want: function resolver(prefix) { return prefix === 'x' ? 'http://www.w3.org/1999/xhtml' : null; } var allLinks, thisLink; allLinks = document.evaluate( "//x:a[@href]", document, resolver, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null ); Only the <a> elements on the sidebar are picked and the rest are still there. Please refer to this, weibo.com

Javascript: Function is defined, but Error says.. Function is not found ! (Strange)

泄露秘密 提交于 2019-12-13 11:43:31
问题 This is my code : function mark() { alert("This is a test box.."); } setTimeout("mark()",5000); Error : Function mark() is not found !! There is some other issue.. as it works on http://jsfiddle.net/russcam/6EXa9/ but its not working in my application.. so can you help me debug this ? What else can be the reason.. By the way I am running this inside a GreaseMonkey script ! 回答1: If you are using GreaseMonkey, any functions you define are sandboxed by GM and not available in the main window.

Greasemonkey: look for a string between two elements [closed]

社会主义新天地 提交于 2019-12-13 10:57:57
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . I'm writing a Greasemonkey script, which should do a simple thing: if there's a certain string between the <h2> element (always only one on the page) and the first occurrence of an <h3> element (can be several of

Greasemonkey script for changing “inbox” to “test” at yahoo mail

ⅰ亾dé卋堺 提交于 2019-12-13 09:19:35
问题 with Greasemonkey script, I would like to change the link "inbox" to "test", it's probably in AJAX. How to do it? Ram Update from OP remark, below: Well i'm a newbie, could some one please write the script to change the word "inbox" to "test" on yahoo mail? (Andy's script didn't work for me) 回答1: well greasemonkey is just javascript injected into the page. So assuming you know how to use greasemonkey, you just need to write a short peice of code to find the link/button and manipulate its text

Make List of several “GM_listValues”, calling a function to remove themselves

有些话、适合烂在心里 提交于 2019-12-13 08:49:34
问题 I'm currently working on a Greasemonkey script, that allows to add users to an ignore list which will block their comments from being rendered. I store their userID via "GM_setValue". Everything is working just fine but I have problems to render the "Manage your ban-list" part of my script to pardon a user. The codeblock I have troubles with: var banList = GM_listValues(); // Array of Usernames var manageBans = $("#content_content"); //The <div> I want to render the Banlist in. manageBans