tampermonkey

How do I add a userscript installation button to my web page?

本小妞迷上赌 提交于 2019-12-19 04:31:09
问题 I need to host a userscript on an internal company website. How do I build the href so that Greasemonkey will install the userscript when the link is clicked? I tried a simple <a href="user.js">Install Userscript</a> but Chrome and Firefox simply show the file source instead of installing the userscript. 回答1: Your link should look like: <a href="https://example.com/your_script.user.js">Click to install script X</a> <small>(A userscript engine, like Tampermonkey, is required.)</small> In order

Greasemonkey/Tampermonkey @match for a page with parameters

本小妞迷上赌 提交于 2019-12-18 12:07:50
问题 I'm working on a script that must be executed in a certain page, depending on the parameters it has. The URL is like this: http://example.com/page.php?key1=value1&key2=value2&... And I need to match it when page.php has the key1=value1 among its parameters. Now I'm using @match http://example.com/page.php?key1=value1&* But it doesn't match if page.php has no other parameters. It also won't match if key1 is not the first parameter either. Is there any way to match a page according to a

Can't fix my script to log the way I need it

跟風遠走 提交于 2019-12-18 09:54:11
问题 So this is really getting on my nerves. I needed to explain this a bit better so here it is. I'm trying to make my script log in google's console a specific way. I've got some images to help explain.. Let's hop on in. So first, this is how it's currently logging.. Which is good so far. I'm happy with this. It's not one big array, nice and neat. Image below: (https://i.gyazo.com/81fc8d76b34a81f4fff7fc23e94f1bf1.png) So this is the last log emitted(You can see in the image above.) It's just

Can't fix my script to log the way I need it

久未见 提交于 2019-12-18 09:54:04
问题 So this is really getting on my nerves. I needed to explain this a bit better so here it is. I'm trying to make my script log in google's console a specific way. I've got some images to help explain.. Let's hop on in. So first, this is how it's currently logging.. Which is good so far. I'm happy with this. It's not one big array, nice and neat. Image below: (https://i.gyazo.com/81fc8d76b34a81f4fff7fc23e94f1bf1.png) So this is the last log emitted(You can see in the image above.) It's just

Tampermonkey to select a dropdown value. It has no ID or name, just a class?

ぃ、小莉子 提交于 2019-12-18 08:57:07
问题 I'm writing a Tampermonkey code for a webpage like ConverTo: It's supposed to automatically select the second option in a dropdown: <select class="format-select"> <option value="mp3">MP3</option> <option value="mp4">MP4 (video)</option> </select> , several seconds after the page is fully loaded. But nothing happens. My code: ...... // @match https://www.converto.io/* // @require http://code.jquery.com/jquery-1.11.0.min.js // ==/UserScript== $(document).ready(function(){ setTimout(test(),10000

How to Transfer All Greasemonkey userscripts to Tampermonkey on Firefox 57+

霸气de小男生 提交于 2019-12-18 02:51:15
问题 After read that Greasemonkey recommends users to install Tampermonkey or Violentmonkey. I've installed Tampermonkey and now I'm trying to transfer all my Greasemonkey 3.x scripts to be opened on Tampermonkey, but I can't find it's location or even how to do it. I've read this question that says where and how it's located on Chrome, but where is it on Firefox 57+? How can I transfer it? PS: I'm expecting I won't need to update every userscript I have. 回答1: Based on derjanb comment I'm

Basic method to Add html content to the page with Greasemonkey?

纵饮孤独 提交于 2019-12-17 22:20:39
问题 Is there a Greasemonkey method to append basic HTML content to the end of a page right after the <body> tag, or right before it ends? I found before/after methods but I need to know names of elements which may change page to page.. 回答1: The quick and dirty way: Please only use innerHTML for brand- new content. var newHTML = document.createElement ('div'); newHTML.innerHTML = ' \ <div id="gmSomeID"> \ <p>Some paragraph</p> \ etc. \ </div> \ '; document.body.appendChild (newHTML); A complete

How to hide certain elements using Greasemonkey?

别等时光非礼了梦想. 提交于 2019-12-17 19:56:13
问题 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 hidden. So, is there any way to hide these elements using Greasemonkey? (Editor's

Simulating a mousedown, click, mouseup sequence in Tampermonkey?

拜拜、爱过 提交于 2019-12-17 06:29:29
问题 I would like to simulate a whole click not just document.getElementsByClassName()[0].click(); How do I do that? Search results all seem to be about handling such events, not triggering them. 回答1: Send mouse events. Like so: //--- Get the first link that has "stackoverflow" in its URL. var targetNode = document.querySelector ("a[href*='stackoverflow']"); if (targetNode) { //--- Simulate a natural mouse-click sequence. triggerMouseEvent (targetNode, "mouseover"); triggerMouseEvent (targetNode,

How to change a class CSS with a Greasemonkey/Tampermonkey script?

混江龙づ霸主 提交于 2019-12-17 04:57:10
问题 I'm trying to set the background image of the body, but only where it uses the class banner_url . The HTML is as follows: <body id="app_body" class="banner_url desktopapp" data-backdrop-limit="1"> Basically, I would like to force the page to use the following CSS instead: .banner_url { background: url('http://www.pxleyes.com/images/contests/kiwis/fullsize/sourceimage.jpg') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover;