Cross-Domain-Scripting

  • Thread starter torsten.reiners
  • Start date
T

torsten.reiners

Hi,

We try to implement a "web-application" where we have to access a
general web-site -- loaded into a frame -- from another frame using
JavaScript. We know that there are security issues concerning cross-
domain-scripting. Our first soultion (which is working) uses the
setting of the required privilege to have "Universal BrowserReas"

netscape.security.PrivilegeManager.enablePrivilege
("UniversalBrowserRead");

BTW: We are currently using Firefox 1.5

The current version works if we have everything stored on the local
harddrive and also start it from that location (e.g.: c:\
\application.html). Having the script on a server produces the known
error that the rights to access cross-domain-content is not allowed.
Same applies to cross-domain-AJAX access.

Is there any way that we can allow a script to access information from
another domain as we are currently doing it with the PrivilegeManager
above? And is there a solution for the Internet Explorer.

Not sure if you need more information (e.g. the html or javascript).
Please let me know so we can post this

Best
Torsten Reiners
(e-mail address removed)-hamburg.de
 
T

töff

You might pass the info from one domain to another via the URL. The
window property "window.location.href" will give you not only the
address of the window but also whatever extra info occurs after a "?" in
the URL.

For example, I have a store at http://store.mysteryandmagic.com
and it opens to a list of all our for-sale items.

But if I want to pass info to the Store, say, to display our coffee mug
instead of the all-items list, I use this:

http://store.mysteryandmagic.com/?CoffeeMug

and then the javascript accesses "window.location.href", parse it for
whatever follows the "?", and then does whatever is appropriate, based
on what it finds after the "?".

I dunno if this trick will help in your particular situation, but it is
a handy way to move information into a javascript program from outside.
Good luck!

-- töff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top