| |||||||
| Top Tip : Click here to Boost Your PC & Chrome Browsing Speed |
![]() |
| | Thread Tools | Display Modes |
|
#1
| |||
| |||
| 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 06:47 PM.. Reason: Uppercase title's first letter |
|
#2
| ||||
| ||||
| For future reference, if you want to just get the host URL (and no subpages) you can just use: Code: location.protocol+"//"+location.hostname
__________________ ~ Projects ~ Specialized: Carapass Auction Watcher Libraries: bliplib Tools: manifest syntax highlighting & snippits |
|
#3
| |||
| |||
| 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
| ||||
| ||||
| 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 Libraries: bliplib Tools: manifest syntax highlighting & snippits |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cannot access site... | mg2 | Chrome Troubleshooting | 17 | 11-30-2009 08:10 PM |
| Get site thumbnail / favicon | Kyrax | Chrome Tips & Tricks | 6 | 11-09-2009 04:29 AM |
| Site homepage with some bad code? | NicholasPufal | Chrome Central | 12 | 07-19-2009 10:57 AM |
| Pictures uploaded to this site | Stamga | General Chat | 3 | 04-07-2009 01:27 AM |
| Tips from the main site | Chrome | Chrome Tips & Tricks | 5 | 09-10-2008 03:13 PM |