greasemonkey

How to change CSS-classes with Greasemonkey?

两盒软妹~` 提交于 2019-12-11 13:54:42
问题 I've been trying to gin up a small Greasemonkey script, that takes the content of a class and changes it to another class. Basically it would change: <ul class='user_type_1'> into: <ul class='administrator'> But, I'm completely green to javascript & Greasemonkey, and all the research I did just left me even more confused. Ideally I would like someone to explain in detail HOW I achieve this, instead of just handing over a script that works (though currently even that would be a help). 回答1:

Greasemonkey: Add a link in a table

我们两清 提交于 2019-12-11 12:26:48
问题 I want to modify an HTML page which looks something like this: <html><head><title>Test</title></head> <body bgcolor=white link=black alink=black vlink=black text=black> <table cellpadding=0 ><tr><td class=tiny align=center> <a href="apple.php">apple</a> <a href="peach.php">peach</a> <a href="banana.php">banana</a> <a href="strawberry.php">strawberry</a><br> <a href="carrot.php">carrot</a> <a href="bean.php">bean</a> <a href="tomato.php">tomato</a> <a href="cucumber.php">cucumber</a> </td></tr

How to obtain a cookie from a remote domain using Greasemonkey?

岁酱吖の 提交于 2019-12-11 12:26:21
问题 I'm writing a Greasemonkey (v2.3) script that basically screen-scrapes the contents served by lema.rae.es/drae/srv/search, for lack of an API of any sort. The thing is, I want to query that URL from Google Translate, a different domain. For that, I can use GM_xmlhttpRequest without problems, but a GET request to a specific URL (for instance lema.rae.es/drae/srv/search?val=test) yields an HTML page with a hidden form that gets POSTed after calling the challenge() javascript function -- which

Using Javascript to click on a given button AND have it open in a new window

≯℡__Kan透↙ 提交于 2019-12-11 11:51:32
问题 When this page loads, I want to simulate automatically clicking the send me this thing button whilst having it open in a new window (or new tab) There will only ever be one send me this thing button on any page like that What for? This is for Greasekit on Fluid.app, which is similar to Greasemonkey. 回答1: That Button is a link and that page uses jQuery. So you can get the button like: var buyItBtn = $("a:contains('Send me this thing')"); Then modify the link to open in a new tab/window. Then

Add table values through browser extension

夙愿已清 提交于 2019-12-11 11:41:40
问题 I have a set of data in a website table that has multiple pages that I need to parse and add the values of a certain field, specifically price field and an inventory field. I don't have access to the code or database. Does anyone know if there is an extension in Chrome or Firefox that can facilitate this type of functionality? Here is an example of the data I need: I would like a very simple summary like "Total Inventory Price: $500.00". I wouldn't even mind if it were per page and I had to

Increment value within a URL in order to parse data from attributes that are paginatied

落花浮王杯 提交于 2019-12-11 11:13:18
问题 I'm working on a Greasemonkey script, and would like to tally a specific value from an attribute. Problem is, the attribute values I want are paginated. I've tried changing the URL to see if it can list everything in one page, but no luck. It always limits to a view of only 40 per page. I was wondering if the best way to achieve this is by incrementing a value in the URL, by using an if and then statement. For instance, if a certain element is present (.standard-row), the start=0 in the URL

document.write won't show the text on the web page

…衆ロ難τιáo~ 提交于 2019-12-11 10:48:43
问题 When I run this simple greasemonkey script alert("hello"); alert(document.location); document.write("hello"); alert("hello"); Only the first two statements work, the third and fourth statement do nothing. What could be wrong here? 回答1: It seems that document.write() only works intermittently from Greasemonkey -- maybe due to the sandbox. I haven't found a foolproof recipe for duplicating the issue yet. However, the DOM-based approach always seems to work. Use this code: //--- Erase everything

Google maps link from greasemonkey default zoom

房东的猫 提交于 2019-12-11 10:45:01
问题 Something seems to have changed on google maps recently that changed the default zoom. I've tried adding zoom=17 and z=17, but nothing seems to change. I'm just creating a hyperlink on page using the following url & query "https://maps.google.com/?zoom=17&q=" +myAddress.replace(/ /g, '+'); In the past it's always worked fine no matter what address I used in the query. Just wondering what may have changed and if I need to work around this another way. 回答1: Google maps, now, will not zoom past

Duplicate greasemonkey script doesn't work - inexplicable

送分小仙女□ 提交于 2019-12-11 10:28:52
问题 This is just too bizarre. I'm new to Greasemonkey, but I downloaded a script from userscripts.org and it works fine. I then created a duplicate of that script using 'New User Script' from the GM menu and then pasted the original script into the new script. I then disable the old script and enable the new script and the new script doesn't work. 回答1: You "pasted the original script into the new script" without any edits? Some things that can go wrong: The new script should have a different name

How to track how many automatic-upgrade downloads my Greasemonkey script has?

送分小仙女□ 提交于 2019-12-11 10:22:26
问题 I have a page with a series of links to Greasemonkey userscripts. The userscripts have @updateURL parameters set, so that when I upload a new version to the page people who have the script installed either have their version of it updated automatically or are asked if they want to upgrade. This all works fine. I have Google analytics installed on the hosting page, so I can see how many hits the page gets, but what I would like to know is how many people are getting the updates. The normal