/    Sign up×
Community /Pin to ProfileBookmark

pop-up window external url in frames

I have a site that uses 3 frames (top, middle and bottom section). The top and bottom section load html pages from the original server. The middle section loads a html page from another server. So far no problems.

However in the html file that is loaded from the external server I need to pop-up a window. Apparently it is not aloud to pop-up windows within frames that load an external URL (security issues).

I’m not that good at Javascript and besides this page has not originally been developped by me (frames are not exactly great). However I looked around and it seems that I have to use enableExternalCapture() and captureEvents(). In my search I found these few words on the matter which I pasted below:

“When a window with frames wants to capture events in pages loaded from different locations (servers), you need to use captureEvents in a signed script and precede it with enableExternalCapture. You must have the UniversalBrowserWrite privilege.”

Basically I have no idea how to construct a valid Javascript code that will allow me to open a pop-up window in a frame loading an external URL. I hope anyone will be able to help me. Thanks in advance.

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliAug 03.2003 — simply put...bad idea....
Copy linkTweet thisAlerts:
@deej80authorAug 03.2003 — Well, after looking at the situation for about 5 more minutes I just gave up and decided it was time to get rid of the frames alltogether. It's more work for me, but in the end the result will be better.
Copy linkTweet thisAlerts:
@KarterJKAug 03.2003 — I am not sure I understand what it is you are trying to do. It should be fairly straight forward
Copy linkTweet thisAlerts:
@deej80authorAug 03.2003 — Hehe. I thought it should be fairly straightforward too. Anyway I decided to go woth another solution. Bascially you can't load an external URL in a pop-up window that has been activitated from within a frame.

For example.

I have a file called index.html which is a framset with 3 sections (frames): top.html, middle.html and bottom.html. In middle.html I have a link that activates a pop-up window throught Javascript (with window.open or any other) which loads the URL http://www.otherserver.com/file.html. Now index.html, top.html, middle.html and bottom.html are located on http://www.myserver.com/. However as I indicated earlier the file I wan't to load in the pop-up window is located at a different server (myserver.com vs. otherserver.com).

For security reasons this method is not allowed. It is of course true that using frames is bad alltogether. Using frames with pop-up windows is really dumb. Using frames with pop-up windows that load an external URL is just suicide.

In theory it should be possible to make the above work. Unfortunatly my knowledge of Javascript is limited. Which in this case was a good thing, atleast I'll came up with something more suitable and less 1997.
×

Success!

Help @deej80 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...