On Nov 30, 2011, at 9:23 AM, Ben wrote:

> On 30 Nov 2011, at 15:22, Keary Suska wrote:
> 
>> On Nov 30, 2011, at 7:48 AM, Ben wrote:
>> 
>>> On 30 Nov 2011, at 14:24, John Joyce wrote:
>>> 
>>>> On Nov 30, 2011, at 8:11 AM, Mike Abdullah wrote:
>>>> 
>>>>> On 30 Nov 2011, at 12:00, Ben wrote:
>>>>> 
>>>>>> I am writing an app which opens up multiple WebView's of the same web 
>>>>>> site. The problem I'm having is that the website detects that I already 
>>>>>> have a page open and closes the previously opened page. 
>>>>>> 
>>>>>> So I'm presuming that the method by which it is detecting identical 
>>>>>> pages is via cookies, and if I can make each WebView use a separate 
>>>>>> NSHTTPCookieStorage rather than the normal shared singleton, I think I 
>>>>>> might solve the problem. 
>>> 
>>> Sure, well I have ruled out that the site is using IP and hostName, and as 
>>> far as my knowledge of Javascript goes, I don't think  javascript running 
>>> on one web page, can access a separate web page unless it created it 
>>> itself. That's all the methods I can think of that they may be using .
>> 
>> JavaScripts may effect any page whose URL shares the same domain, in 
>> essence. So a JavaScript on a site page could detect whether a page has been 
>> previously loaded and close it. I would say that it is unlikely a cookie 
>> issue as the JavaScript approach is easier and less error prone.
>> 
>> You may also want to consider *why* the site is doing this. They may be 
>> using window names or id's that must be unique for the site to function 
>> properly, and circumventing it could cause unexpected issues.
> 
> Oh OK, well that put's an entirely different perspective on things. I did not 
> know that same domain pages could communicate. 

> So if I were to hunt down the culprit javascript I could perhaps disable it 
> with something likeā€¦
> [windowController.webview 
> stringByEvaluatingJavaScriptFromString:@"location.hostname=null;"];

This approach may not work as it depends on how and when the browser performs 
its security checks. If I were to hazard a guess I would think that this 
approach would not work as it could be a security hole. As long as you can 
determine the method used to close the window you can manipulate the DOM to 
prevent it. I.e., at some point a script is deriving the window object. Figure 
out how and you can prevent it. But also keep in mind my previous caveat--doing 
so could cause the site to not function properly.

> Thanks. Oh the reason I want this functionality is that I have multiple 
> accounts for dealing shares, every day I have to set up 3 different browsers 
> and 10 or so different pages and it takes 10 minutes of my life every day. So 
> I'm trying to find a way to do everything I need, open every page and account 
> in 1 click.


Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to