Dynamic changing the security of a frame in HTA

Posted on 2008-10-28
Last Modified: 2012-05-05
I've made a html application with a number of functions. It will run on a local pc in a corporate network.
One function is to expand the hta window to get information from not-local locations in an Iframe.

I've got two external sources. In the parent hta window one button opens the page from location#1, another buttons opens from location #2
The problem now is that for location#1 the iframe should have:  application="yes", but then the page from the other location doesn't work  as expected.

So what i'm looking for is some code to set or reset the security setting of this iframe when a button is clicked.

The only reference I found on this subject is:
but I can't simplify this code to make it work.

Any help please? Thanks!
Question by:Wirwar
  • 2
  • 2
LVL 75

Expert Comment

by:Michel Plungjan
ID: 22829588
Erm. Imagine if you could.
Bad security. Virus behaviour

Anyway, WHY does the other location not work as expected. I have never had any such issues

Author Comment

ID: 22829882
Hi mplungian.. that's what I thought in the first place, until the above posted link to the security manager came up..

I'll explain a bit more about the situation:

The hta toolbar I developed supports development and testing activities for a webshop.

One function is to create different sql scripts from a product number. To execute the script we  can use a webpage in the sitemanager. This sitemanager is a framed 'website' of its own.

I can open this particular sql form 'stand alone' in the Iframe of the (expanded) toolbar. So we don't have to browse through the sitemanager site. For quick look-ups this is a plus.

However, there is a sitemanager login-screen before this sql-page, with a frame-checker.
The problem is: after this check page refreshes to the top of my toolbar.

When I have the iframe in my toolbar *without* application=yes, this iframe-check does not refresh to the top and after login, the sql page appears in the frame and can be used.
Why this works as described.. I don't know :)

Another function is a documentation tool.
I've got a number of htm files in folders on another server. With a script I read the folders filenames and it generates an index. In the Iframe of the expanded toolbar a menu appears where these filenames of the selected folder are listed and onClick the document can be read.
This is pretty cool, but it works only if the I frame has application = "yes"

And this I why I like to have some kind of frame management.

Security is not an issue in this situation, but I understand that generally spoken this is not really a wanted solution
So it's a no-go? But what about the 'solution' mentioned in the link?

(In my case I can make a 'work-around': I'll add another iframe and show/hide the not-used frame.)
LVL 75

Accepted Solution

Michel Plungjan earned 125 total points
ID: 22834102
I cannot tell you. I do not see the security manage do what you need it to do.
Showing and hiding the appropriate iframe is not even a workaround in my opinion, but a simple way to achieve what you want.

Without seeing the frame-checker I cannot tell you why. Sounds like a location.replace thing

Author Closing Comment

ID: 31510666
Thank you for your time (and the great good work you and the other members in the hall of fame are doing!)  I hoped that manager thing could help, but on your advise i'm going to work out the second frame option.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question