Welcome guest, is this your first visit? Create Account now to join.
Results 1 to 5 of 5

This is a discussion on Help for a Noob - Userscripts within the Chrome Troubleshooting section, part of the Google Chrome category: Hi, I've just migrated fully over to Chrome (using the dev build 4.0.206.1) and I'm really enjoying the new speed ...


  1. #1
    flub is offline Junior Member
    Join Date
    Sep 2009
    Posts
    22

    Question Help for a Noob - Userscripts

    Hi,

    I've just migrated fully over to Chrome (using the dev build 4.0.206.1) and I'm really enjoying the new speed etc. However there were a few userscripts that I've been using that I need in working in Chrome. I've managed to get most working by using the enable scripts switch and placing my user scripts into the User Scripts directory.

    However, 1 script just does not seem to work in Chrome.

    Code:
    // ==UserScript==
    
    // @name           Nbcmv photos directory switch
    
    // @namespace      http://userscripts.org/users/23652
    
    // @description    Adds /nbcmvi/ to the picture paths
    
    // @include        *
    
    // @exclude        about:*
    
    // @exclude        chrome:*
    
    // ==/UserScript==
    
    
    // XPath but the array returned is a normal array[x]
    
    // Syntax: $x("//a", 7);
    function $x(p, type) {
      var i, arr = [], t = type || 6, xpr = document.evaluate(p,document,null,t,null);
      for (i = 0; item = xpr.snapshotItem(i); i++) {arr.push(item);}
      return arr;
    }
    
    var i, l, path, links = $x("//a[contains(@href, '/photos/hires/')]");
    
    
    for(i=0; i<links.length; i++) {
    l = links[i];
    l.href = 'http://images.nbcmv.com/nbcmvi/photos/hires/' + l.href.split("/photos/hires/")[1];
    }
    This script replaces the download link on this page (http://nbcumv.com/photography.html) from this format

    NOTE: The above links won't actually work they are there for examples

    But it does not seem to work.

    Can any of you experts shed some light onto what I may need to change.
    Last edited by flub; 09-09-2009 at 11:26 AM.

  2. #2
    sulasno's Avatar
    sulasno is offline Super Moderator
    Join Date
    Sep 2008
    Location
    Bangkok
    Posts
    1,759

    Default

    clicking on your links produced the following;

    LOGIN FAILED

    You either typed in wrong user ID or password or you do not have sufficient access privileges to view this item.

    Try to log in again by clicking here.

    Or if you are not registered, please click here to register to receive your NBC Universal Media Village account.

  3. #3
    flub is offline Junior Member
    Join Date
    Sep 2009
    Posts
    22

    Default

    Hi,

    Sorry, yes the actual links wont work as you need an account their. The links were provided to show how the script needs to transform the links from their original destination to the new new destination.

    The script works fine in Firefox but does not seem to run in Chrome.

  4. #4
    PAEz's Avatar
    PAEz is offline Moderator
    Join Date
    Aug 2009
    Location
    Australia
    Posts
    656

    Default

    gDay,
    I dont know why this didnt work for you?
    Im not setup to use userscripts but I thought Id turn it into an extension and have a look...and well, it seemed to work?
    nbcImages.crx
    The only thing I think i changed was the url match, which is now...
    http://nbcumv.com/*
    ...hope that covers all the pages you wanted. I changed it from * bcoz I really hate the idea of these scripts running on pages they shouldnt. If you need a different/more locations then just edit it once its installled and reload.

  5. #5
    flub is offline Junior Member
    Join Date
    Sep 2009
    Posts
    22

    Default

    Wow!

    Thank you so much, that worked like a charm.

    I REALLY appreciate it!.

Similar Threads

  1. Replies: 57
    Last Post: 10-29-2015, 12:16 PM
  2. Userscripts in Chrome
    By Luc VN in forum Chrome Talk
    Replies: 16
    Last Post: 10-29-2009, 06:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •