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

This is a discussion on [bookmarklet] Test a site in different resolutions within the Chrome Plugins section, part of the Google Chrome category: Did create this one today when I've found a site which simulates the different resolutions a screen can be - ...


  1. #1
    NicholasPufal is offline Senior Member
    Join Date
    Jun 2009
    Location
    Porto Alegre, Brazil
    Posts
    109

    Default [Bookmarklet] Test a site in different resolutions

    Did create this one today when I've found a site which simulates the different resolutions a screen can be - the online tool is provided by http://viewlike.us/.

    It's pretty useful for webdesigners.

    That small ER and everything else is just to be sure that http:// and the final / (bar) are removed upon click (by what I did test here those 2 things would result in a forbidden error there)

    Here it's:

    Code:
    javascript:var%20end=window.location.href;end=end.replace(/http:\/\//,"");if(end.indexOf("/",end.length-1)!=-1){end=end.substr(0,end.length-1);}window.location.href="http://viewlike.us/?url="+end;
    Last edited by NicholasPufal; 08-01-2009 at 05:47 PM. Reason: Uppercase title's first letter

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

    Default

    For future reference, if you want to just get the host URL (and no subpages) you can just use:
    Code:
    location.protocol+"//"+location.hostname
    Or if you don't want the http like it doesn't seem you do, just use location.hostname
    ~ 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

  3. #3
    NicholasPufal is offline Senior Member
    Join Date
    Jun 2009
    Location
    Porto Alegre, Brazil
    Posts
    109

    Default

    Thanks Waha.

    But the problem is that doing like that i'm not able to get sub sections from a website.

    For example, let's say the page I'm in and want to take a screenshot is: http://www.site.com/anotherthinghere/articles/10 - if I just use localtion.hostname, that simply wouldn't work as expected.

    The way it's now makes possible to have complex URLs there.

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

    Default

    Oh sorry it seemed like you were trying to clear off the subdirectories, but you were just getting rid of trailing /'s. ^^;
    ~ 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. Cannot access site...
    By mg2 in forum Chrome Troubleshooting
    Replies: 17
    Last Post: 11-30-2009, 08:10 PM
  2. Get site thumbnail / favicon
    By Kyrax in forum Chrome Tips & Tricks
    Replies: 6
    Last Post: 11-09-2009, 04:29 AM
  3. Site homepage with some bad code?
    By NicholasPufal in forum Chrome Central
    Replies: 12
    Last Post: 07-19-2009, 09:57 AM
  4. Pictures uploaded to this site
    By Stamga in forum General Chat
    Replies: 3
    Last Post: 04-07-2009, 12:27 AM
  5. Tips from the main site
    By Chrome in forum Chrome Tips & Tricks
    Replies: 5
    Last Post: 09-10-2008, 02:13 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
  •