Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #22556

Re: AJAX using local

Message-ID <1895059.lkMUc99Mlk@PointedEars.de> (permalink)
From Thomas 'PointedEars' Lahn <PointedEars@web.de>
Organization PointedEars Software (PES)
Date 2014-01-10 18:05 +0100
Subject Re: AJAX using local
Newsgroups comp.lang.javascript
References <7L6dnSGUUJE1hVLPnZ2dnUVZ_vydnZ2d@westnet.com.au> <2682810.tskAjyEyLv@PointedEars.de> <HoednRdin6yQrVLPnZ2dnUVZ_uOdnZ2d@westnet.com.au> <4863656.Y3eb4HivdN@PointedEars.de>

Show all headers | View raw


Thomas 'PointedEars' Lahn wrote:

>> I know how to query a window's opener from the window but if the course
>> can only make a call like
>> 
>> var xhr = new XMLHttpRequest();
>> xhr.open('get', 'http://www.track.com/the/project.php?find=progress');
>> xhr.send();
>> 
>> how does it get info from the window opener?
> 
> It cannot.

Rethinking this, my answer is not wrong, but if the access policy is open 
for small allowances, there are possibilities (without claim of 
completeness):

- The opener code can open the course window providing vital information in
  the course URI, provided the parameters used by the opener are not used
  by the course already.  The course code can then process document.URL or
  window.location;

- (Not recommended) The opener code can set the name of the course window
  to include vital information, and the course code can read window.name.

Either of the former two approaches may create a security leak if the vital 
information includes privileged information.

- If the opener document and the course document are within the same
  second-level domain, the opener code can set a cookie with that domain
  before opening the course window, and the course code can read it:

- Likewise, the opener code can set local storage or session storage
  data before, after which the course code can read it.  This should
  be preferred to cookies.

In any case, compliant with Cookie laws, with the former two approaches the 
user may need to be informed that such information is being stored on their 
machine.

-- 
PointedEars

Twitter: @PointedEars2
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

AJAX using local Andrew Poulos <ap_prog@hotmail.com> - 2014-01-10 08:45 +1100
  Re: AJAX using local Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-09 23:17 +0100
    Re: AJAX using local Andrew Poulos <ap_prog@hotmail.com> - 2014-01-10 10:25 +1100
      Re: AJAX using local Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-10 01:07 +0100
        Re: AJAX using local Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-01-10 18:05 +0100
      Re: AJAX using local JJ <duh@nah.meh> - 2014-01-10 17:24 +0700

csiph-web