Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Modifying a URL in IE

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,55230
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Modifying a URL in IE
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 Modifying a URL in IE - 1/11/2008 12:42:09 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
I did a quick search of the forum but didn't find just what I was looking for so I thought I might post the question here and see what comes from it.

I am looking to speed up my productivity while working in Microsoft CMS and one of the things that seems to slow me down regularly is having to switch between what the general public sees and the editing side of things.

For instance, I would have the following URL in public view (obviously a generic url):
https://extranet.website.com/folder/folder/etc...

In order to get to the editing side, I have to add the bits in red:
https://extranetpub.website.com:1443/folder/folder/etc...

I've figured out how to access the Group Policy settings to create the Toolbar button in IE but I can't figure out how to actually program a script that will add the two parts I need easily. An added bonus would be to then load the URL on clicking the button.

Any thoughts or ideas? Am I in the wrong section? lol
 
 
Post #: 1
 
 RE: Modifying a URL in IE - 1/11/2008 12:56:53 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi seething,

while it's fairly easy to change a string like

  https://extranet.website.com/folder/folder/etc...

to something like

  https://extranetpub.website.com:1443/folder/folder/etc...

by using (String) Replace or RegExp.Replace - e.g.

  sUrl = Replace( "https://extranet.website.com/folder/folder/etc...", "extranet.", "extranetpub." )

I don't understand enough of the context your problem to come up with
a practical solution. Could you give some more details?

Regards

ehvbs
 

(in reply to seething)
 
 
Post #: 2
 
 RE: Modifying a URL in IE - 1/11/2008 1:06:50 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
Sorry, I should have included more.

The site that I am publishing on is an intranet that I didn't develop so I had no control over it's creation.

When I want to edit a page's content, I have to switch to the alternate address with the pub and port number so that the controls show up at the side of the page for me to access content, change page properties, etc.

What I want to do is create a simple button in the Taskbar that will allow me to swtich to that alternate URL easily regardless of where I am in the site. Since every section of this intranet always begins with https://extranet.website.com/... that is the only section I would need to modify. Conversely, I would need to have the rest of the URL remain unchanged. Sometimes that is an established address and sometimes it is server code such as "/NR/exeres/42C1A5BC-AB72-4830-82E9-22B37B0E9BE8,frameless.htm?NRMODE=Unpublished&WBCMODE=PresentationUnpublished&wbc_purpose=Basic".

Does that clear it up at all?

< Message edited by seething -- 1/11/2008 1:13:19 AM >

(in reply to seething)
 
 
Post #: 3
 
 RE: Modifying a URL in IE - 1/11/2008 1:30:39 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi seething,

I found this page

  http://msdn2.microsoft.com/en-us/library/ms964271.aspx

Is it talking about your "Microsoft CMS"?

If you press your "simple button in the Taskbar", would code like this
be called:


      

Will a function like


      

display the first 50 chars from the text you want to change the Urls in?

If yes to all the questions we could begin to tackle the problem of replacing
exactly the parts of the text you want to and how to 'write the changed
text back'.

Good luck! (seems like we need it!)

ehvbs

(in reply to seething)
 
 
Post #: 4
 
 RE: Modifying a URL in IE - 1/11/2008 1:36:33 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
Maybe I'm looking at this in too difficult a way.

All I need is to have the word extranet become extranetpub and the .com to have :1443 added to it. Sort of a find and replace in the URL.

And yes, that is the beast of a software that I ahve to deal with. It's bloated, difficult and generally very Microsoft in terms of inflexability.

(in reply to ehvbs)
 
 
Post #: 5
 
 RE: Modifying a URL in IE - 1/11/2008 1:51:07 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Maybe I'm looking at this in too difficult a way.

What exactly can/can't you do?

(a) make code be called when the button is pressed

(b) access the whole text or a list of all Urls in the document

(c) given the text (all or just the Url) - change it

(d) put the changes back into the document

(in reply to seething)
 
 
Post #: 6
 
 RE: Modifying a URL in IE - 1/11/2008 1:59:46 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
A) Code is being called using a simple button in the IE Toolbar. See:http://www.windowsdevcenter.com/pub/a/windows/2005/04/26/ie_buttons.html
B) Need ONLY the URL for the current page
C) Change the current URL to have https://extranetpub.website.com:1443 at the beginning
D) Put changed URL back in browser address bar and go there

*laughing* This is fun, right? My biggest problem is that I don't know what to ask for since I don't know what the correct terms are. I'm sure there is a simple phrase of some sort that would clear this all up.

(in reply to ehvbs)
 
 
Post #: 7
 
 RE: Modifying a URL in IE - 1/11/2008 2:40:42 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
If it helps, this is the function I want to call as it would be written in javascript:

location.href = window.location.href.replace(window.location.host, "extranetpub.website.com:1443");

(in reply to seething)
 
 
Post #: 8
 
 RE: Modifying a URL in IE - 1/11/2008 3:59:21 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
If you have more than one window open pointing to the "extranet" domain then it will only navigate the first one that it finds.
I could not find a reference to the window object being passed using the method you have chosen to use.
So this is all I could think of at the moment.

Point your toolbar button to a vbscript file.
Put these contents in the file.

Edit.vbs

      

< Message edited by Rischip -- 1/11/2008 4:01:24 AM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to seething)
 
 
Post #: 9
 
 RE: Modifying a URL in IE - 1/11/2008 4:29:30 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
This version will toggle all of your windows between edit and public viewing modes.

edit.vbs


      

< Message edited by Rischip -- 1/14/2008 4:52:50 AM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to Rischip)
 
 
Post #: 10
 
 RE: Modifying a URL in IE - 1/11/2008 4:36:15 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
You both are my hero's officially. While I most likely won't go out and get any tattoos stating that fact, I can safely say that you have saved me a ton of time.

If you need any graphic design work done or help with something like that, let me know!!!

(in reply to Rischip)
 
 
Post #: 11
 
 RE: Modifying a URL in IE - 1/11/2008 4:42:54 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
I will see if there is a way to get the window object where the toolbar button was launched from, but I don't see anywhere that it is possible. At least not yet.
As far as graphic work goes. Well, I need an icon and a graphic for my website. But I think that's a little beyond the level of effort I put into your post.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to seething)
 
 
Post #: 12
 
 RE: Modifying a URL in IE - 1/11/2008 4:43:33 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
I was thinking a Grim Reaper holding a link of chain instead of a scythe?

_____________________________

Rischip
Author of - The Grim Linker

(in reply to Rischip)
 
 
Post #: 13
 
 RE: Modifying a URL in IE - 1/11/2008 4:46:22 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
I'll give it a shot. From your perspective, you may have done little but from mine you've done a lot.

Got any ideas as to what style, colors, that sort of thing?

(in reply to Rischip)
 
 
Post #: 14
 
 RE: Modifying a URL in IE - 1/11/2008 4:52:28 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
Got an idea for you but you'll have to give me a day or two to hash it out. 

(in reply to seething)
 
 
Post #: 15
 
 RE: Modifying a URL in IE - 1/11/2008 7:36:58 AM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
Ok, a quick design off the top of my head. Hope you like it. We can discuss more as you get ideas.

http://www.kylebellamy.com/grim/

(in reply to seething)
 
 
Post #: 16
 
 RE: Modifying a URL in IE - 1/11/2008 8:16:09 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
A little heavy duty linked chain and that would be great.....Awesome

_____________________________

Rischip
Author of - The Grim Linker

(in reply to seething)
 
 
Post #: 17
 
 RE: Modifying a URL in IE - 1/12/2008 1:16:58 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
[SLIGHTELY OFF TOPIC]
Thanks, Rischip, for saving my posterior and showing me a technique new to me!
Regards
ehvbs

(in reply to Rischip)
 
 
Post #: 18
 
 RE: Modifying a URL in IE - 1/13/2008 11:47:12 PM   
  seething

 

Posts: 12
Score: 0
Joined: 1/11/2008
Status: offline
Sorry for the delayed reply but I had a busy weekend and couldn't get back to this. I'll see if I can get some chain in there. :)

(in reply to ehvbs)
 
 
Post #: 19
 
 RE: Modifying a URL in IE - 1/14/2008 4:27:01 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
ehvbs,
I learn stuff from your posts all the time. So the thanks is mutual.

This method has the result he was looking for, but not using the original intended method.
I think he was looking for access to the DOM through the Toolbar button, but I couldn't find that, at least not yet.
So we went around the DOM to the shell to get it working.

Edit: Actually it's more like From IE -> Shell -> to find the correct Application Window -> to get back into the DOM.

< Message edited by Rischip -- 1/14/2008 5:06:48 AM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to ehvbs)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Modifying a URL in IE Page: [1] 2   next >   >>
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts