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

This is a discussion on Getting current url? within the Plugins Troubleshooting section, part of the Chrome Plugins category: Hi everyone, I'm writing an is.gd extension for Chrome. (Yes, I'm aware that a Bit.ly extension already exists, I'm doing ...


  1. #1
    GA-B1-G5 is offline Junior Member
    Join Date
    Oct 2009
    Posts
    4

    Default Getting current url?

    Hi everyone,

    I'm writing an is.gd extension for Chrome. (Yes, I'm aware that a Bit.ly extension already exists, I'm doing this for various reasons; fun, a preference for is.gd over bit.ly, etc).

    My problem is this: When trying to get the url of the current visible tab, i get "chrome-extension://gckiclhecgkgapklkfibjpcdhcadcgpc/isgd_toolstrip.html".

    The js I'm using is
    Code:
    <div class="toolstrip-button" onclick="chrome.tabs.create({url:'http://is.gd/create.php?longurl=' + window.location.href})">
    Anyone know of a workaround?

  2. #2
    Michael3185 is offline Senior Member
    Join Date
    Apr 2009
    Location
    Lincoln, UK
    Posts
    377

    Default

    My simple video grabber uses the Tabs API get function, which returns a tab structure that contains the URL. There's some code here.

  3. #3
    Waha's Avatar
    Waha is offline Senior Member
    Join Date
    Apr 2009
    Location
    Oregon
    Posts
    788

    Default

    You can use the location object from a Content Script to get the page's location. When using it from a Background Page or Toolstrip you only get the location object for those pages (since they are their own pages).
    So for those, yeah, use the Tab API Michael linked.
    ~ Projects ~
    Specialized: Carapass Auction Watcher, Kongregate Chat
    Libraries: bliplib
    Tools: manifest syntax highlighting & snippits
    ~ Happy to make extensions for pay too ;D ~
    Portfolio: Search and Share

Similar Threads

  1. [New Ext] Session Save - Bookmark current session
    By jw12345 in forum Chrome Plugins
    Replies: 33
    Last Post: 12-17-2010, 11:06 AM
  2. Open current page in firefox
    By bartvdc in forum Chrome Plugins
    Replies: 10
    Last Post: 11-03-2009, 02:38 PM
  3. Check current version of plugins
    By sulasno in forum Plugins Troubleshooting
    Replies: 0
    Last Post: 10-04-2009, 03:50 AM

Posting Permissions

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