userscripts

How to correctly work on a GreaseMonkey userscript using git?

隐身守侯 提交于 2019-11-29 14:25:04
问题 I am working on a userscript for Firefox, so I use GreaseMonkey. Moreover, to facilitate the development, I use git to update the different versions of my code. Now, let me try to explain the issue. When I add to GreaseMonkey the userscript from my local git directory, then new files are created in the gm_scripts folder of my Firefox profile. GreaseMonkey use these files as source and not my git directory, so if I want to modify my code and test some stuff, I have to change the files inside

console.log is not working when used in a Firefox, Greasemonkey script

半世苍凉 提交于 2019-11-29 12:16:45
问题 My userscript prints some information using console.log() . This works fine in Chrome, but when I install this userscript in Firefox (Greasemonkey), the web console in Firefox is not displaying anything. I searched for a solution and some suggested to use unsafeWindow but it is also not showing any output. Moreover unsafeWindow cannot be used for chrome. I even installed Firebug but it was no use. How can I resolve this? For example, I tried this userscript in Firefox: // ==UserScript== //

My userscript only works when the page is refreshed or on iframes, not the main page?

主宰稳场 提交于 2019-11-29 10:58:49
This simple code doesn't work on a Facebook page. This code only alerts when I refresh the page . If I go to that page from my Facebook profile , with my mouse; The script stops working. There are no alerts or errors. :( It looks like the whole script doesn't work until I refresh. // ==UserScript== // @name Purge My Facebook // @namespace http://www.arda.com // @description test // @include https://*.facebook.com* // @include http://*.facebook.com* // @version 1 // ==/UserScript== window.setTimeout (isParent, 500); function isParent () { if (window.self == window.top) { alert ("main window");

How to overwrite a function using a userscript?

ε祈祈猫儿з 提交于 2019-11-29 10:28:12
问题 I want to change parts of the webpage display, is it possible to overwrite a function with a userscript? Below is the function I would like overwritten (also found Here): function StartDrawing() { if ((typeof (systemsJSON) != "undefined") && (systemsJSON != null)) { var stellarSystemsLength = systemsJSON.length; $('#mapDiv').empty(); if (stellarSystemsLength > 0) { InitializeRaphael(); var i = 0; for (i = 0; i < stellarSystemsLength; i++){ var stellarSystem = systemsJSON[i]; DrawSystem

Adding jQuery UI to Greasemonkey script fails with external CSS file

时间秒杀一切 提交于 2019-11-29 02:31:54
问题 I'm trying to add jquery-ui to a Greasemonkey script. my full code: test.user.js : // ==UserScript== // @name Test // @namespace rajat.khandelwal // @description Test script // @include * // @require js/jquery-1.6.2.min.js // @require js/jquery-ui-1.8.16.custom.min.js // @require css/ui-darkness/jquery-ui-1.8.16.custom.css // ==/UserScript== alert('hi'); and In current directory I added JS and CSS directory. It throws error saying syntax error in css Error: syntax error Source File: file:///C

Run Greasemonkey on html files located on the local filesystem?

拥有回忆 提交于 2019-11-28 22:19:15
问题 I have an API documentation lying around on my Harddrive and to ease my workflow, I have written a simple script that modifies the page for my needs. I've developed it using FireBug on FireFox. @include -ing webpages works correctly, but Greasemonkey does not seem to detect pages on the local file-system? I would like to have an include like // @include *R13/Python*R13/* Which should match for example file:///Z:/Eigene%20Dateien/Cinema4D/Documentations/R13/Python%20R13/modules/c4d/index.html

Chrome extension set to `run_at` `document_start` is running too fast?

只谈情不闲聊 提交于 2019-11-28 20:47:00
EDIT: Something was wrong with my Chrome browser and creating a conflict with my script, a full reinstall eliminated whatever the problem source was. If I happen to find out what was causing it I will include it in here. EDIT2: Just to let anyone reading this in 2017 know that I haven't forgotten this and I have never had this problem since my previous edit. EDIT3: It is 2019 and so far I've never had this problem again. I have been learning how to create a simple Chrome extension which is a userscript port. The script works perfectly with Tampermonkey with the setting run at to document-start

Hijacking a variable with a userscript for Chrome

*爱你&永不变心* 提交于 2019-11-28 18:59:26
I'm trying to change the variable in a page using a userscript. I know that in the source code there is a variable var smilies = false; In theory I should be able to change it like that: unsafeWindow.smilies = true; But it doesn't work. When I'm trying to alert or log the variable to the console without hijacking I get that it's undefined. alert(unsafeWindow.smilies); // undefined !!! EDIT: I'm using Chrome if it changes anything... http://code.google.com/chrome/extensions/content_scripts.html says: Content scripts execute in a special environment called an isolated world. They have access to

Gmail extension/gadget API - how to add a button to the compose toolbar?

↘锁芯ラ 提交于 2019-11-28 18:22:46
I'm trying to figure out how can I add a button to the Gmail compose window. In "Gmail Labs" they have some extensions that add certain buttons For example "Send & Archive" button and "Inserting images" button, so I assume this is possible. I checked their API here and it seems that you can either add a gadget to left sidebar or use contextual gadgets that are dependent on the message context. I'm looking for a way to add a button to the toolbar of the compose window, and both options don't seem to support it. Do you know how can this be done? If it's not possible using Gmail API, is there

Where are Chrome/Tampermonkey userscripts stored on the filesystem? [closed]

空扰寡人 提交于 2019-11-28 18:14:10
Where are Chrome/Tampermonkey userscripts stored on the filesystem? I want to edit user scripts directly instead of using the hokey in-browser editor. Brock Adams Tampermonkey scripts are super easy to update via the Tampermonkey tab. See the Tampermonkey FAQ , or just try it. Tampermonkey scripts were stored in a special SQLite database and were/are not directly editable in file form. Update: As of version 3.5.3630 , Tampermonkey scripts are now stored using Chrome's extension storage. They are still not editable in file form, but the developer of Tampermonkey (derjanb) has helpfully made a