Peter Schneider


MCT, MCSD.NET, MCAD.NET, MCDBA

News

Locations of visitors to this page

  

Austrian .NET Community

Open Url Activity for IE8

More or less often you find Url's in webpages (for example in forum comments) which are not hyperlinked.

You then Copy and Paste the Url into the Browser's address bar to open it. With this little IE8 activity you can open the Url via the activity smarttag.
OpenUrlActivity

As the {selection} variable is not accepted in the action attribute of the execute element, I've entered the [your domain] placeholder, which you might want to change to your domain to get the sample running.

<?xml version="1.0" encoding="UTF-8"?>
<openServiceDescription xmlns="
http://www.microsoft.com/schemas/openservicedescription/1.0">
<homepageUrl>
http://[your domain]</homepageUrl>
<display>
<name>Open URL in Browser</name>
<icon>
http://www.live.com/favicon.ico</icon>
</display>
<activity category="share">
  <activityAction context="selection">
    <preview action="
http://[your domain]/Redirect.aspx">
       <parameter name="url" value="{selection}"/>
    </preview>
    <execute action="
http://[your domain]/Redirect.aspx">
       <parameter name="url" value="{selection}"/>
    </execute>
  </activityAction>
</activity>
</openServiceDescription>

To get this sample running save the above code snippet to a XML file and upload it to [your domain] and save it as OpenUrlActivity.xml

You then need a little "install" routine:

<button onclick="window.external.addService('http://[your domain]/OpenUrlActivity.xml')">Add OpenUrl Activity
</button>

Needless to say that you also need the Redirect.aspx where you redirect the user to the value passed with the url parameter.

For a detailed description of the Activity XML Format see http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=ie8whitepapers&ReleaseId=566

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required)