Search Results

Search found 38 results on 2 pages for 'userscript'.

Page 1/2 | 1 2  | Next Page >

  • Help making userscript work in chrome

    - by Vishal Shah
    I've written a userscript for Gmail Pimp.my.Gmail & i'd like it to be compatible with Google Chrome too. Now i have tried a couple of things, to the best of my Javascript knowledge (which is very weak) & have been successful up-to a certain extent, though im not sure if it's the right way. Here's what i tried, to make it work in Chrome: The very first thing i found is that contentWindow.document doesn't work in chrome, so i tried contentDocument, which works. BUT i noticed one thing, checking the console messages in Firefox and Chrome, i saw that the script gets executed multiple times in Firefox whereas in Chrome it just executes once! So i had to abandon the window.addEventListener('load', init, false); line and replace it with window.setTimeout(init, 5000); and i'm not sure if this is a good idea. The other thing i tried is keeping the window.addEventListener('load', init, false); line and using window.setTimeout(init, 1000); inside init() in case the canvasframe is not found. So please do lemme know what would be the best way to make this script cross-browser compatible. Oh and im all ears for making this script better/efficient code wise (which is sure there is)

    Read the article

  • Userscript: pass a variable to new page

    - by Anon
    I am trying to pass a variable from one page, load another and enter that information. something Like this: When 127.0.0.1/test.html&ID=1234 location.href = "127.0.0.1/newpage.html" if (location.href == newpage.html){ var e = document.GetElementById("Loginbx"); e.Value = ID } I don't have access to modify 127.0.0.1/test.html nor newpage.html but would like to pass variables to them from another. Is this possible?

    Read the article

  • How do i fix this JS scope in GM_xmlhttpRequest

    - by acidzombie24
    When i run this code alert 2 shows 6 different href links. alert 3 shows the last href 6 times. How do i make it use the same object (linkdom aka thelink) as alert 2. NOTE: This is in a greasemonkey script { var linkdom = thelink; alert('2' + linkdom.getAttribute("href")); GM_xmlhttpRequest({ method: 'GET', url: href, onload: function(resp){ //... alert('3' + linkdom.getAttribute("href")); } }); //... }

    Read the article

  • Is there a Google Chrome extension or userscript that will "bottom-justify" form fields?

    - by Dennis Williamson
    When using Google Chrome, I would like to have a page scroll up so the bottom of form fields are at or above the bottom of the window when I click in the text input to begin entering something. However, if the form height is larger than the window, the top should not be scrolled off automatically. I want to go from: to: An bonus essential feature would be for the input box to automatically be resized in height (but not width) to fill the window. This feature ideally would be configurable: enable/disable and margin above and below. There should be no scrolling or resizing for one-line input boxes. Is there an extension or userscript that does something like this?

    Read the article

  • Print from Chrome without the print dialogs? Using Greasemonkey userscript maybe?

    - by Eric Hanson
    We're developing a browser-based warehouse app that needs to print labels and invoices regularly. We want to be able to print to the local printer without going the the usual browser print dialogs. Is this possible? Possibly using a greasemonkey userscript? We don't want to have to setup a whole CUPS printer network and deal with all that, but warehouse pickers having to click through a print dialog 1000 times a day isn't an option. We're printing PDFs, not sure if that matters. If we could do this another way using HTML5 or something else I'm open to course changes or other ideas here.

    Read the article

  • Userscript to add website screenshot for each google search result?

    - by naxa
    Before the "preview pane" for google web search results came out from their labs, there already were userscripts to have a visual snapshot for each and every website in a web search query result. Now with the default preview, one needs to hover over the preview button for each site and gets a big (and slower) preview. The older, user-made solutions put the screenshot there for each result element. How could I achieve to get a screenshot statically for every item in the search result nowadays?

    Read the article

  • Greasemonkey @require jQuery not working "Component not available"

    - by Greg K
    I've seen the other question on here about loading jQuery in a Greasemonkey. Having tried that method, with this require statement inside my ==UserScript== tags: // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js I still get the following error message in Firefox's error console: Error: Component is not available Source File: file:///Users/greg/Library/Application%20Support/ Firefox/Profiles/xo9xhovo.default/gm_scripts/myscript/jquerymin.js Line: 36 This stops my greasemonkey code from running. I've made sure I included the @require for jQuery and saved my js file before installing it, as required files are only loaded on installation. Code: // ==UserScript== // @name My Script // @namespace http://www.google.com // @description My test script // @include http://www.google.com // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js // ==/UserScript== GM_log("Hello"); I have Greasemonkey 0.8.20091209.4 installed on Firefox 3.5.7 on my Macbook Pro, Leopard (10.5.8). I've cleared my cache (except cookies) and have disabled all other plugins except Flashblock 1.5.11.2, Web Developer 1.1.8 and Adblock Plus 1.1.3. My config.xml with my Greasemonkey script installed: <UserScriptConfig> <Script filename="myscript.user.js" name="My Script" namespace="http://www.google.com" description="My test script" enabled="true" basedir="myscript"> <Include>http://www.google.com</Include> <Require filename="jquerymin.js"/> </Script> I can see jquerymin.js sat in the gm_scripts/myscript/ directory. Additionally, is it common for this error to occur in the console when installing a Greasemonkey script? Error: not well-formed Source File: file:///Users/Greg/Documents/myscript.user.js Line: 1, Column: 1 Source Code: // ==UserScript==

    Read the article

  • Allow opening a new tab with Ctrl+T on all websites in Firefox

    - by Martin J.H.
    In Firefox, certain websites and plugins (Adobe PDF Plugin) appear to "capture" the Control key, so that when I try to open a new tab using "Ctrl+t", nothing happens - or worse, something unexpected happens. Examples: On the Codecademy site, while editing code, Ctrl+T either does nothing, or (when Flash is disabled) switches the position of the two characters next to the cursor. When viewing PDF's with the Adobe PDF Plugin, Ctrl+T does nothing. Is there a way to disable this "feature"? I would like "Ctrl+t" to always "talk" to Firefox! Edit: After searching superuser deeper, this question is very similar to the questions: "How to prevent keystroke grabbing/hijacking by websites in Firefox?" "How do I prevent pages I visit from overriding selected Firefox shortcut keys?". The answers to these questions are interesting and relevant, but do not give a method on how to disable combinatinos such as "Ctrl+t". Maybe a modified Greasemonkey script is the easiest solultion. Edit 2 - Attempt at a solution The following UserScript (Use GreaseMonkey to install it) successfully captures Ctrl+t on some sites (Google Search site, for instance - PopUp "Gotcha" appears), but not on the Codecademy site. I found another question pertaining to this subject here: "How to forbid keyboard shortcut stealing by websites in Firefox". It was raised in 2010, and the consensus was: It can't be done. // ==UserScript== // @name Disable Ctrl T interceptions // @description Stop websites from highjacking keyboard shortcuts // // @run-at document-start // @include * // @grant none // ==/UserScript== // Keycode for 't'. Add more to disable other ctrl+X interceptions keycodes = [84]; var lastPressedButton = [0]; document.addEventListener('keydown', function(e) { //uncomment to find out the keycode for any given key // alert(e.keyCode ); if (keycodes.indexOf(e.keyCode) != -1 && e.ctrlKey) { e.cancelBubble = true; e.stopImmediatePropagation(); alert("Gotcha!"); } return false; });

    Read the article

  • How to catch GMail auto-refresh

    - by nameanyone
    I wrote a userscript to highlight the current row in GMail (indicated by the arrow). Unfortunately the highlight will only stay until GMail Inbox is auto-refreshed, which happens quite often. Is there a way to catch that event so I could reapply the highlighting? I don't want to do it on timeout. There is another userscript that does that and it loads up CPU.

    Read the article

  • Redirect faster with Greasemonkey

    - by Chad
    I'm using Greasemonkey to redirect certain URLs to another but I would like to redirect before the URL to be redirect loads. Currently I'm using this simple script: //==UserScript== // @name Redirect Google // @description Redirect Google to Yahoo! // @include http://*.google.com/* //==/UserScript== window.location.replace("http://www.yahoo.com") In the above, google appears for a second and then redirected to google. I want to go yahoo immediately. Is it possible, and how?

    Read the article

  • Any hosted versions of jQuery that have the 'Access-Control-Allow-Origin: *' header set?

    - by Greg Bray
    I have been working with jQuery recently and ran into a problem where I couldn't include it in a userscript because xmlhttpRequest uses the same origin policy. After further testing I found that most browsers also support the Cross-Origin Resource Sharing access control defined by W3C as a workaround for issues with same origin policy. I tested this by hosting the jQuery script on a local web server that included the Access-Control-Allow-Origin: * http header, which allowed the script to be downloaded using xmlhttpRequest so that it could be included in my userscript. I'd like to use a hosted version of jQuery when releasing the script, but so far testing with tools like http://www.seoconsultants.com/tools/headers I have not found any sites that allow cross-origin access to the jQuery script. Here is the list I have tested so far: http://www.asp.net/ajaxlibrary/CDN.ashx http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery Are there any other hosted versions of jQuery that do allow cross origin access?

    Read the article

  • Finding and changing currencies using Greasemonkey

    - by Noam Smadja
    It doesnt find nor replaces the strings.. may be wrong regex? // ==UserScript== // @name CurConvertor // @namespace CurConvertor // @description noam smadja // @include http://www.zavvi.com/* // ==/UserScript== textNodes = document.evaluate( "//text()", document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); var searchRE = new RegExp('\d\d.\d\d','gi'); var replace = searchRE*5.67; for (var i=0;i<textNodes.snapshotLength;i++) { var node = textNodes.snapshotItem(i); node.data = node.data.replace(searchRE, replace); i wrote this, but its not doing a think. even when i change the string in the regex to a string in the webpage it still does nothing.. what am i missing? :)

    Read the article

  • jQuery autocomplete not always working on elements

    - by PoweRoy
    I'm trying to create a greasemonkey script (for Opera) to add autocomplete to input elements found on a webpage but it's not completely working. I first got the autocomplete plugin working: // ==UserScript== // @name autocomplete // @description autocomplete // @include * // ==/UserScript== // Add jQuery var GM_JQ = document.createElement('script'); GM_JQ.src = 'http://jquery.com/src/jquery-latest.js'; GM_JQ.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(GM_JQ); var GM_CSS = document.createElement('link'); GM_CSS.rel = 'stylesheet'; GM_CSS.href = 'http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.css'; document.getElementsByTagName('head')[0].appendChild(GM_CSS); var GM_JQ_autocomplete = document.createElement('script'); GM_JQ_autocomplete.type = 'text/javascript'; GM_JQ_autocomplete.src = 'http://dev.jquery.com/view/trunk/plugins/autocomplete/jquery.autocomplete.js'; document.getElementsByTagName('head')[0].appendChild(GM_JQ_autocomplete); // Check if jQuery's loaded function GM_wait() { if(typeof window.jQuery == 'undefined') { window.setTimeout(GM_wait,100); } else { $ = window.jQuery; letsJQuery(); } } GM_wait(); function letsJQuery() { $("input[type='text']").each(function(index) { $(this).val("test autocomplete"); }); $("input[type='text']").autocomplete("http://mysite/jquery_autocomplete.php", { dataType: 'jsonp', parse: function(data) { var rows = new Array(); for(var i=0; i<data.length; i++){ rows[i] = { data:data[i], value:data[i], result:data[i] }; } return rows; }, formatItem: function(row, position, length) { return row; }, }); } I see the 'test autocomplete' but using the Opera debugger(firefly) I don't see any communication to my php page. (yes mysite is fictional, but it works here) Trying it on my own page: <body> no autocomplete: <input type="text" name="q1" id="script_1"><br> autocomplete on: <input type="text" name="q2" id="script_2" autocomplete="on"><br> autocomplete off: <input type="text" name="q3" id="script_3" autocomplete="off"><br> autocomplete off: <input type="text" name="q4" id="script_4" autocomplete="off"><br> </body> This works, but when trying on another pages it sometimes won't: e.g. http://spitsnieuws.nl/ works but http://nu.nl and http://dumpert.nl don't work. Trying the autocomplete of jquery ui has more problems: // ==UserScript== // @name autocomplete // @description autocomplete // @include * // ==/UserScript== // Add jQuery var GM_JQ = document.createElement('script'); GM_JQ.src = 'http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'; GM_JQ.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(GM_JQ); var GM_CSS = document.createElement('link'); GM_CSS.rel = 'stylesheet'; GM_CSS.href = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css'; document.getElementsByTagName('head')[0].appendChild(GM_CSS); var GM_JQ_autocomplete = document.createElement('script'); GM_JQ_autocomplete.type = 'text/javascript'; GM_JQ_autocomplete.src = 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js'; document.getElementsByTagName('head')[0].appendChild(GM_JQ_autocomplete); // Check if jQuery's loaded function GM_wait() { if(typeof window.jQuery == 'undefined') { window.setTimeout(GM_wait,100); } else { $ = window.jQuery; letsJQuery(); } } GM_wait(); // All your GM code must be inside this function function letsJQuery() { $("input[type='text']").each(function(index) { $(this).val("test autocomplete"); }); $("input[type='text']").autocomplete({ source: function(request, response) { $.ajax({ url: "http://mysite/jquery_autocomplete.php", dataType: "jsonp", success: function(data) { response($.map(data, function(item) { return { label: item, value: item } })) } }) } }); } This will work on my html page, http://spitsnieuws.nl and http://dumpert.nl but not on http://nu.nl. (dumpert didn't work on the plugin autocomplete) //http://spitsnieuws.nl <input class="frmtxt ac_input" type="text" id="zktxt" name="query" autocomplete="off"> //http://dumpert.nl <input type="text" name="srchtxt" id="srchtxt"> //http://nu.nl <input id="zoekfield" name="q" type="text" value="Zoek nieuws" onfocus="this.select()" type="text"> Anyone know why the autocomplete functionality doesn't work? Why the request to the php page is not being made? And why I can't add my autocomplete to google.com?

    Read the article

  • How to set Chrome's user script version number.

    - by Atli
    Hey. I've been wondering how I might set the version number displayed for user-scripts in Chrome's extension tab So far the obvious methods have failed: // ==UserScript== // @version 1.1.5 // @uso:version 1.1.5 // ==/UserScript== I know Greasemonkey for Firefox doesn't use a version value, but since Chrome actually displays a version number, I thought it might. Perhaps this is a feature that has not been implemented? Or maybe it was never intended to be there, but it is there because extensions have version numbers, and user-scripts are currently installed as extensions? (I'm using the Linux beta, version: 4.0.249.43, by the way) Thanks. Edit: Seems this is listed as an unconfirmed bug in the Chromium bug database (Issue 30760)

    Read the article

  • Is there a way to disable all other Java Scripts other than my own with Grease Monkey

    - by DKinzer
    I need help getting a Grease Monkey with JQuery Script to run on a broken site. I'm trying to get the following GM script to run, but the page I want it to work on has a JS error and my JS does not get executed. // ==UserScript== // @name BILL INFO PAGE ALTER // @namespace http://jenkinslaw.org // @description Alter the web page in order to pretty print // @include http://www.legis.state.pa.us/cfdocs/billinfo/bill_history.cfm?* // @require http://code.jquery.com/jquery-1.4.2.min.js // ==/UserScript== */ (function() { //Make a copy of the bill table var bill_table = $('.main_table').clone(); //empty the whole lot $(body).empty(); //append the bill back to the dom. $(body).append(bill_table); }()); Thanks! D

    Read the article

  • Dynamically loaded jQuery with GreaseMonkey inconsistent on pages (refreshing seems to fix it)... do

    - by uprightnetizen
    Hi, I want a custom page analysis footer on every site I visit... so I've used a method to attach JQuery to unsafeWindow. I then create a floating footer on the page. I want to be able to call commands in a menu, do some processing, then put the results in the footer. Unfortunately it sometimes works, sometimes it doesn't. At least two alerts should happen in the printOutput function. Sometimes it only fires one, then it (crashes?) without error? On other pages, both alerts fire and it finds the element, but it doesn't add the extra text. (e.g. www.linode.com) Refreshing the page, then running the printOutput command again seems to always work. Does anyone know what's going on??? The userscript can be installed at: http://www.captionwizard.com/test/page_analysis.user.js // ==UserScript== // @name page_analysis // @namespace markspace // @description Page Analysis // @include http://*/* // ==/UserScript== (function() { // Add jQuery var GM_JQ = document.createElement('script'); GM_JQ.src = 'http://code.jquery.com/jquery-1.4.2.min.js'; GM_JQ.type = 'text/javascript'; document.getElementsByTagName('head')[0].appendChild(GM_JQ); var jqueryActive = false; //Check if jQuery's loaded function GM_wait() { if(typeof unsafeWindow.jQuery == 'undefined') { window.setTimeout(GM_wait,100); } else { $ = unsafeWindow.jQuery; letsJQuery(); } } GM_wait(); function letsJQuery() { jqueryActive = true; setupOutputFooter(); } /******************************* Analysis FOOTER Functions ******************************/ function printOutput(someText) { alert('printing output'); if($('div.analysis_footer').length) { alert('is here - appending'); $('div.analysis_footer').append('<br>' + someText); } else { alert('not here - trying again'); setupOutputFooter(); $('div.analysis_footer').append('<br>' + someText); } } GM_registerMenuCommand("Test Output", testOutput, "k", "control", "k" ); function testOutput() { printOutput('testing this'); } function setupOutputFooter() { $('<div class="analysis_footer">Page Analysis Footer:</div>').appendTo('body'); $('div.analysis_footer').css('position','fixed').css('bottom', '0px').css('background-color','#F8F8F8'); $('div.analysis_footer').css('width','100%').css('color','#3B3B3B').css('font-size', '0.8em'); $('div.analysis_footer').css('font-family', '"Myriad",Verdana,Arial,Helvetica,sans-serif').css('padding', '5px'); $('div.analysis_footer').css('border-top', '1px solid black').css('text-align', 'left'); } }());

    Read the article

  • dynamically create greasemonkey script

    - by qwertymk
    I'm trying to create a dynamic GM script. Here's what I thought would do it win = window.open('myScript.user.js'); win.document.writeln('// ==UserScript=='); win.document.writeln('// @name sample script'); win.document.writeln('// @description alerts hi'); win.document.writeln('// @include http://www.google.com/*'); win.document.writeln('// ==/UserScript=='); win.document.writeln(''); win.document.writeln('(function(){alert("hi");})()'); win.document.close(); Well it doesn't. Anyone have any ideas how to go about doing this?

    Read the article

  • How to take search query and append modifers to the end of it

    - by Kimber
    This is a greasemonkey question. What I'm trying to do is modify an old google discussions script. What were wanting to do is be able to take the google search query and add modifiers to the end of it. Like this: search query: "superuser" modifiers: inurl:greasemonkey+question end result: "superuser" inurl:greasemonkey+question The old script creates a new div within the "hdtb_more_mn" element which is where you get the new discussions tab. However, since the "tbm=dsc" option to do a discussion search has died, this script no longer works. Hence the need to add modifiers to your searches. I tried to edit the script, but it appends the modifiers to the end of the url which includes "&client=firefox-a&hs=8uS&rls=org.mozilla:en-US:official". This means you're also searching for the above as well as your query, which doesn't work. I would like to be able to append the modifiers @ the end of the search querty, rather than the whole URL. I'm just not sure how to code it to where it adds the below "&tbm=" stuff within "discussionDiv.innerHTML" to the end of the query. The google search id seems to be, "gbqfq" for the search box, but I'm not sure how to add this id. Here is the old script // ==UserScript== // @name Add Back Google Discussions // @version 1.4 // @description Adds back the Discussion filters to Google Search // @include *://*.google.tld/search* // ==/UserScript== var url = location.href; if (url.indexOf('tbm=dsc') < 0) addFilterType('dsc', 'Discussions'); function addFilterType(val, name) { var searchType = document.getElementById('hdtb_more_mn'); var discussionDiv = document.createElement('DIV'); discussionDiv.className = 'hdtb_mitem'; discussionDiv.innerHTML = '<a class="q qs" href="'+ (url.replace(/&tbm=[^&]*/g,'') + '&tbm=' + val) +'">'+name+'</a>'; searchType.innerHTML += discussionDiv.outerHTML; } Thanks for any help, or suggestions on who to ask. Google Chrome has an extension for discussion searches, but FF doesn't seem to have one as of yet, which is why I'm trying to modify the above.

    Read the article

  • Change the background color of selected text in Google Docs to increase readability [migrated]

    - by gene_wood
    How can I override or change the background color of text selected in Google Docs? It is difficult for me to see the difference and I would like to increase the contrast or difference. After Google restyled Google Docs last year (or earlier this year), I've been unable to see selected text. It's possible this is a visual deficiency with my eyes. In Google Docs, under both Google Chrome (17.0.963.83 (Official Build 127885) m) and Firefox (11.0), when I select text inside a Google Doc, the selected text has a background of color #d6e0f5. Compare this to the default browser background color of #2f65c0. (I determined the color of the selected text background by taking a screenshot and using the color picker tool in Photoshop). I've tested this using a brand new Firefox profile as well as google chrome profile. Here's a section of a screenshot showing the selected text : I've tried using a userscript to override the CSS to go back to the default text selection color using the "Stylish" plugin with this css : ::selection { background:#2f65c0; color:#ffffff; } ::-moz-selection { background:#2f65c0; color:#ffffff; } ::-webkit-selection { background:#2f65c0; color:#ffffff; } This code works on other sites, but I'm unable to get it to work on Google Docs. (I tested on other sites but applying the userscript to a different domain and using bright yellow instead of the default dark blue #2f65c0.) When you use Google Docs, do you have the same color background for selected text or something different? (To test this, browse to docs.google.com , create a document, type text into the document, select the text with the mouse by dragging over it, take a screenshot, load the screenshot up in an image editor and determine the background color of the selected text.) This color differential (between light blue #d6e0f5 and white #fffff) may be easy to see for others and the problem lies with my eyes.

    Read the article

  • DataTables - Remove DataTables from HTML Table created in different JavaScript File

    - by Matt Green
    So I have a site I visit everyday for work. The DataTables implementation on this site is atrocious. The DataTable is applied to an HTML table that is generated when the page is rendered and then the DataTable is initialized on it. I figured this is great because I can create a little TamperMonkey script to remove the horrible DataTable and create one that functions how I need it to. The DataTable is created via inline Javascript at the end of the document body. I tried the following per the DOCs for the destory() method. // ==UserScript== // @name // @version 0.1 // @description Makes the Invoice Table more user friendly // @include URL // @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js // @require http://cdnjs.cloudflare.com/ajax/libs/datatables/1.10.1/js/jquery.dataTables.min.js // @copyright 2014+, Me // ==/UserScript== $(function() { var t = $('#customer_invoices').DataTable(); t.destroy(); }); It does not "remove those enhancements and return the table to its original un-enhanced state, with the data shown in the table" as stated in the docs. It does not appear to do anything. I think it is either because the table has not been Datatable initialized yet, or that I am not able to access the original DataTable initialization in a different scope. Any help is greatly appreciated as this has me banging my head on the desk.

    Read the article

1 2  | Next Page >