tampermonkey

Tampermonkey's GM_xmlhttpRequest not implementing 'context' property?

被刻印的时光 ゝ 提交于 2019-12-06 11:04:48
问题 I have written a UserScript for Greasemonkey (Firefox) and am testing it for compatibility with Chrome's Tampermonkey, and getting errors in the developer console: Uncaught TypeError: Cannot read property 'profile_url' of undefined Uncaught TypeError: Cannot read property 'encoded_name' of undefined The errors seem to be referencing the onreadystatechanged callback of GM_xmlhttpRequest which is called like this: var flairs = document.querySelectorAll('span.flair'); var steam_re = /(?:(?:https

jQuery click() not working in a Greasemonkey/Tampermonkey script

孤街醉人 提交于 2019-12-06 10:10:09
I am having issues triggering a jQuery click through Greasemonkey/Tampermonkey... jQuery('button').each(function() { jQuery(this).css('background', 'red'); jQuery(this).click(); location.assign("javascript:jQuery(this).click();void(0)"); }​ As you can see I've even tried the location.assign hack but nothing will work, no errors in the console either. Funny thing is that yes, the background colour does change to red so I am assuming it's something in the way .click() works that is different from other jQuery methods. jQuery's .click() is just a shortcut for jQuery's .trigger() and from the Docs

Why does my Tampermonkey script throw “Selenium is not defined”?

£可爱£侵袭症+ 提交于 2019-12-06 07:19:06
I am trying to make it where every time I visit a nike.com sneaker page, it automatically picks my shoe size, adds it to the cart, and checks out for me. Every time I try to run the script, I keep getting this error ERROR: Execution of script 'My Fancy New Userscript' failed! selenium is not defined Here is my script: // ==UserScript== // @name My Fancy New Userscript // @namespace http://*/* // @version 0.1 // @description enter something useful // @match http://*/* // @copyright 2012+, You // ==/UserScript== selenium.select("class=selectBox-label", "10"); // this selects size 10 selenium

Change CSS of the content of an iframe, that has src=“about:blank”, on Chrome

廉价感情. 提交于 2019-12-06 05:54:49
I'm trying this code to apply new design on the Google Tasks page with the extension Tampermonkey . When I try html{ display: none !important } then It displays nothing as the html tag is not under iframe . however, I couldn't modify under iframe[src="about:blank"] element. How should I modify to make it work? shot 1. : Doesn't work for inside of iframe[src="about:blank"] // ==UserScript== // @name test // @match https://mail.google.com/tasks/canvas // @match about:blank // @grant GM_addStyle // ==/UserScript== GM_addStyle ( ` * {color: red !important} ` ); Yes, scripting for iframes with src=

【油猴插件】用Tampermonkey来实现百度云满速下载和批量离线

萝らか妹 提交于 2019-12-05 21:35:54
网易新闻的评论要是直接出现在正文的右边就方便多了; 优酷要是能提供一个不用安装客户端直接下载视频的按钮那就更方便; 在新浪微博中被各种刷屏刷得烦死了,可不可以按照关键词屏蔽一下? 在上网的时候,你是否曾经有过类似上面的感慨呢?难道我们就必须忍受这些让我们不爽的网页吗?NO!今天给大家介绍一款互联网神器——Greasemonkey(油猴脚本)/ Tampermonkey,它能让你除去这些烦恼,甚至,按照你想要的方式来定制网站,享受属于你自己的互联网! 什么是油猴脚本?Greasemonkey / Tampermonkey 功能强大的网络神器“ 油猴 ”。安装油猴脚本扩展后,可以自由定制网页,实现你想要的各种功能,堪称“神器”。比如自由定制网站页面、去除广告弹窗、下载网盘文件、破解某些VIP限制等一系列强大的功能。这些功能源于“油猴脚本”的实现,对于浏览器来说脚本有着占用资源少的特点,因此推荐大家使用。 从此再也不需要开通百度云会员和下载大文件必须使用百度云官方客户端了。 现在介绍一下具体使用步骤: 1. 安装油猴脚本插件 Firefox 及相关的浏览器:Greasemonkey。 在线安装:打开 火狐Greasemonkey插件 ,点击 添加到Firefox,再点击 安装,安装后重启,在附加组件可以看到有个油猴脚本即可。 Google Chrome、360浏览器

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

依然范特西╮ 提交于 2019-12-05 18:36:23
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== // (...) // ==/UserScript== window.location.href = "https://www.facebook.com/?sk=h_chr"; In addition, I also

Force Tampermonkey to run/execute script late

拜拜、爱过 提交于 2019-12-05 16:49:36
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 fell into infinite loop. I tried console to execute a function (but inaccessible by console). So what do I

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

大憨熊 提交于 2019-12-05 15:12:52
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 using: document.getElementyById("somethinbg").click(); I tried double clicking with: document

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

烂漫一生 提交于 2019-12-05 11:36:53
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, evals, etc. Is there any way to get rid of these messages, or protect my override? Maybe unsafeWindow

Using SmtpJS in a userscript: Doesn't work, no error messages?

浪子不回头ぞ 提交于 2019-12-04 19:11:23
I'm trying to send an email through a userscript using smtpjs because it seems the easiest approach. However it seems more difficult than just sending it by javascript that is embedded in a HTML page. Using this userscript ( based on the smtpjs website ) I get no error in the console and no email is sent, is this a framework issue or am I missing something here? (if you suggest an easier way to send emails within a userscript don't hesitate to share) // ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! //