greasemonkey

Access an element inside a dynamically-created, cross-domain iFrame? [duplicate]

六眼飞鱼酱① 提交于 2020-01-03 04:46:12
问题 This question already has an answer here : Userscript to hide a child node of a cross-domain iframe (1 answer) Closed 4 years ago . I want to access an element inside an iFrame, but because of the way the iFrame is being called, I am not succeeding. This is the target page (www1.k9webprotection.com/...). The iframe is on a different subdomain: <iframe src="http://license.k9webprotection.com/..." ...></iframe> Setting a timeout or an event listener for when the iframe is loaded, did not help.

Most concise way to do text replacement on a web page? (using GreaseMonkey)

爷,独闯天下 提交于 2020-01-03 04:17:08
问题 (Yes, yes, I shouldn't use regexps. Alternate solutions are most welcome!) I'm trying to customize my view of a web page I use a lot, using GreaseMonkey to filter out things I don't want to see. Basically, the pages contain a lot of links that look like this: <a class="foo" href="blah">Text</a> and I'd prefer them to look like this: Text<a class="foo" href="blah">[?]</a> so that I stop clicking on the links accidentally. Sadly, my javascript knowledge is negligible, and I'm not sure how to

How to detect if a link already is in the user's bookmarks?

*爱你&永不变心* 提交于 2020-01-03 00:22:14
问题 Is it possible to determine from a Greasemonkey script if a link is already in the bookmarks or not? E. g. if I want to mark all links on the page which are bookmarked. Also, how can I find the name of the folder where this bookmark is stored? 回答1: A Greasemonkey script cannot tell if a link is in the browser's/user's bookmarks because: Ordinary javascript is not allowed to know this for security reasons. Greasemonkey does not provide this capability and Greasemonkey's controlling developers

How do I unbind jquery event handlers in greasemonkey?

心不动则不痛 提交于 2020-01-02 11:15:33
问题 $("p").click(function(){alert('clicked')}); $("p").unbind('click'); Within greasemonkey the click event does not unbind. I believe this is caused by greasemonkey's security model wrapping the associated event object from the first line in XPCNativeWrapper, causing the second line to be unable to "find" it. However, I can't seem to find a workaround. Any suggestions? UPDATE: Something like the following does work in greasemonkey. So I'm still thinking it's an XPCNativeWrapper issue that I can

Remove All onclick Events for an Element

一曲冷凌霜 提交于 2020-01-02 08:20:14
问题 var links = document.body.querySelectorAll("p.sourcelinks a.individual_source_link"); for(var i=0;i<links.length;i++) { links[i].onclick = null; } Is my current code, however it doesn't remove the onclick events. I have no idea what they will be since this is a greasemonkey script. 回答1: Your code only deals with events added by element.onclick case. What about events added with addEventListener (for standards compliant browsers) and attachEvent (for IE)? You need to use removeEventListener

Greasemonkey and jQuery 1.4.2 not working

邮差的信 提交于 2020-01-02 07:24:06
问题 I am attempting to use Greasemonkey and jQuery 1.4.2. When I install the Greasemonkey script jQuery is definitely downloaded and appears in the scripts directory. However the below code doesn't append anything to elements with the class PAPAGETITLE . What am I doing wrong? // ==UserScript== // @name PS Timesheet // @namespace http://www.steelebit.com/gmscripts // @description Used to fix a terrible implementation // @include https://intranet.site.com/* // @require http://ajax.googleapis.com

Parse Greasemonkey metadata and/or grab comments from within a function

五迷三道 提交于 2020-01-02 05:21:13
问题 function blah(_x) { console.info(_x.toSource().match(/\/\/\s*@version\s+(.*)\s*\n/i)); } function foobar() { // ==UserScript== // @version 1.2.3.4 // ==/UserScript== blah(arguments.callee); } foobar(); Is there any way to do this using JavaScript? I want to detect the version number / other attributes in a Greasemonkey script but as I understand it, .toSource() and .toString() strip out comments 1 . I don't want to wrap the header block in <><![CDATA[ ]><> if I can avoid it, and I want to

Using a regular expression in a Greasemonkey @include?

做~自己de王妃 提交于 2020-01-02 04:36:11
问题 I want to specify a bit better where my Greasemonkey script runs. // @include https://example.com/* Works fine, but it is too inaccurate, I want something like: // @include https://example.com/xx-xx/Asset/* xx could be any letter a-z, - is just dash, xx could be any letter a-z. My Idea was use regular expression for any 5 symbols, but I don't know how to properly use it. This is not working and lot more expression which I have tried to: // @include https://example.com/...../Asset/* Any idea

Executing JavaScript to Render HTML for Server-Side Caching

北战南征 提交于 2020-01-02 01:04:28
问题 There are lots of widgets provided by sites that are effectively bits of JavaScript that generate HTML through DOM manipulation or document.write() . Rather than slow the browser down even more with additional requests and trust yet another provider to be fast, reliable and not change the widget output, I want to execute* the JavaScript to generate the rendered HTML, and then save that HTML source.­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­

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

你说的曾经没有我的故事 提交于 2020-01-01 19:23:51
问题 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 //