tampermonkey

Tampermonkey: Trigger event does not work for element

安稳与你 提交于 2019-12-07 18:11:31
I'm trying to add some functionality using Tampermonkey on top of a providers angular application but I'm stuck at this simple thing. I can't replicate the issue using CodePen so we're going to have to go for theories and suggestions. I'll try to be as specific as I can. Adding this interval when the page loads to check when an input with the id serialNumberInput is available. Then I'm adding a dropdown to the form, and attach an onChange event to it to update the serial input field with the value of the selected option. However, the trigger parts just never happens. It does work when I enter

Is the Immediately-Invoked Function Expression (IIFE) pattern really necessary when writing userscripts?

只愿长相守 提交于 2019-12-07 12:43:33
问题 My question is quite similar to What is the purpose of a self executing function in javascript?, however it concerns userscripts (specifically for GreaseMonkey) instead. I see that some userscripts are distributed with this pattern, and some are not. Example of script with the IIFE pattern: (source) // ==UserScript== // (...) // ==/UserScript== (function(){ // if <condition> document.location.href += '?sk=h_chr'; // ... })(); Example of script without it: (source) // ==UserScript== // (...) /

Force Tampermonkey to run/execute script late

自古美人都是妖i 提交于 2019-12-07 10:58:48
问题 How do I force Tampermonkey to run/execute a script late after every document loaded by AJAX? I wish to access those elements in my script and change them. But, even though I set @run-at to document-end in the setting page, it executes while the document wasn't loaded fully. And, it happens at this specific website !! I tried these ways but was unsuccessful: Onload event. I tried while statement to check if all documents were loaded and then continue executing my script but it crashed and

How do I double-click on objects using javascript? Do I have to .click() twice?

99封情书 提交于 2019-12-07 07:51:10
问题 I tried searching for this but the only results that come up are on double click, and never how to automatically double click on something . (trigger a double-click.) I can click once, and have tried doing so twice to "Create" a double-click but failed. I'm assuming that it's because of the timing which is why I set up a timer to see how much time there is between my double clicks. Is there an automated way to double click? I'm not using jQuery so please avoid it in the answer. So I click

Add class in jQuery in Greasemonkey script

非 Y 不嫁゛ 提交于 2019-12-07 07:33:25
I Asked a question earlier and was given a Working solution . One thing I want to do is incorporate jQuery to remove a class F-link-secondary and replace it with F-rank-good/bad/neutral depending on the value of deltaText. On most pages this is what I see: But on a certain page, the F-rank-XXX class is not there and instead there is just a single F-link-secondary which has no style. Here is what I want to do but I am not sure how to incorporate it with the Greasemonkey script. function getRank(deltaText) { if((1 <= deltaText) && (deltaText <= 10)) $("???").removeClass("F-link-secondary")

How to completely disable all exit warning/confirm messages with userscript?

♀尐吖头ヾ 提交于 2019-12-07 06:19:44
问题 I am using chrome in an isolated environment to scan malicious websites to analyze their data to create blacklists. This process is completely automated by userscripts and browser extensions. The problem is that some sites are able to show an exit dialog on beforeunload or unload (I will refer to these as events ). I already override these events , but when the site override my override again, the whole process stops. I mean they can redefine the events with AJAX calls, obfuscated scripts,

How to run Tampermonkey script if page fails to load?

↘锁芯ラ 提交于 2019-12-07 03:32:29
问题 I have a script which runs on pages of a server that sometimes sends doesn't send anything back to the clients (I get the No data received error in Chrome). I want to register this event (notify another server via AJAX) and then reload the page. How can I make sure my script runs even if the page fails to load? 来源: https://stackoverflow.com/questions/23722801/how-to-run-tampermonkey-script-if-page-fails-to-load

谷歌插件-Tampermonkey

冷暖自知 提交于 2019-12-06 15:34:14
通过安装脚本来实现浏览器上百度云文件下载不调取客户端,破解优酷土豆vip等功能 Tampermonkey:Chrome里的“金手指” 安装 它包含:方便的脚本管理、脚本概览、设置多样性、脚本自动更新、安全、兼容性、Chrome 同步、CodeMirror 编辑器、JSHint 语法检查、快速开发、卸载等功能。相当于 Chrome 里的“金手指”。 是不是看完之后还是不知道有什么用?没关系,我也不懂。但是对于小编来说这个插件最大的功能是不用安装百度网盘软件,在网页上就能够直接高速下载大型文件了!下面来给大家说一下该如何操作: 1)安装百度网盘脚本 在 Google 浏览器上安装好「Tampermonkey」插件后还需要另外单独安装脚本来实现你想要的功能。登录网址:https://greasyfork.org/zh-CN 在搜索框输入“百度网盘高速下载助手”,选择第一个安装链接进行安装。 上述方法还是需要翻墙才能实现 采用参考文档的方法安装脚本: 百度网盘直接下载助手 百度网盘批量离线 2)打开网盘链接 当在 Google 浏览器上打开网盘链接后,「Tampermonkey」插件图标会自动搜索到安装好的百度网盘脚本,这样便可以直接下载。 3)下载文件 选择好文件后,点击【高速下载】-【点击直接下载】便可免安装百度网盘客户端下载网盘里的大文件了。 当然「Tampermonkey

Userscript that requires microphone access prompts for permissions in Chrome multiple times

元气小坏坏 提交于 2019-12-06 15:17:56
I wrote a userscript that runs on the page for a game called TagPro that allows for voice recognition. It listens for key words followed by phrases, and depending on the word it puts the phrase into a different chat channel. I'm running the script in Chrome's Tampermonkey extension. The speech recognition library I'm using is Annyang . At the beginning of every game, Chrome confirms that you want to allow the site to use your microphone with a prompt like this: The problem I'm having is that sometimes, in the middle of a game, the prompt will come up again. It doesn't happen in every game, but

Access GM_getValue outside of script

风格不统一 提交于 2019-12-06 11:23:16
问题 Basically the question title. It would greatly benefit me. I want to be able to access GM_getValue outside of my userscript for debugging purposes, or, at the very least, the values and names themselves. I am in Chrome on Windows 10. 回答1: Latest Tampermonkey beta (and eventually normal Tampermonkey) displays the GM values in its dashboard script editor in Storage tab . Visual method: use Storage Area Explorer extension: Open the Tampermonkey dashboard page and invoke devtools by F12 or Ctrl