Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Listen for url changes on opened windows?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  9 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
scottgmead...@gmail.com  
View profile  
 More options Oct 23 2012, 7:10 pm
From: scottgmead...@gmail.com
Date: Tue, 23 Oct 2012 16:10:52 -0700 (PDT)
Local: Tues, Oct 23 2012 7:10 pm
Subject: Listen for url changes on opened windows?

Hey all,

Forgive me if I've missed something obvious here (I'm coming from the front
end dev world, so am a little out of my element), but I'm wondering if
there's a way I can listen for url changes on an opened window? I've tried:

openedWindow.addEventListener("load",function() {
  alert(openedWindow.location.href);

});

But it fails to report the location beyond the initial page load. Have also
tried polling openedWindow (not elegant I know), but it reports
'swappedout://' as the href as soon as I change the url in the nw address
bar and fails thereafter.

I suppose I'm looking for an extension to the window api - something like
the tabs.onUpdated api for Chrome Extensions<https://developer.chrome.com/extensions/tabs.html#event-onUpdated>
.

Thoughts?

Cheers,
-Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Zhao Cheng  
View profile  
 More options Oct 25 2012, 2:10 am
From: Zhao Cheng <zcb...@gmail.com>
Date: Thu, 25 Oct 2012 14:10:24 +0800
Local: Thurs, Oct 25 2012 2:10 am
Subject: Re: [node-webkit] Listen for url changes on opened windows?
After the window has changed its URL, its javascript context will be
completely lost. Event you can listen to the url change event, you
will not be able to get new window's `window` object, which means you
can do nothing with the new window. This limitation is determined by
browser nature.

So you should never refresh the whole page, you need to use ajax to
refresh only part of your page.

--
Cheng
Intel Open Source Technology Center

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger  
View profile  
 More options Oct 25 2012, 2:12 am
From: Roger <wen...@gmail.com>
Date: Thu, 25 Oct 2012 14:12:21 +0800
Local: Thurs, Oct 25 2012 2:12 am
Subject: Re: [node-webkit] Listen for url changes on opened windows?

On Thu, Oct 25, 2012 at 2:10 PM, Zhao Cheng <zcb...@gmail.com> wrote:
> After the window has changed its URL, its javascript context will be
> completely lost.

Right. But the Node's context would not? So the code in Node context can do
this job.

Roger


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger  
View profile  
 More options Oct 25 2012, 4:56 am
From: Roger <wen...@gmail.com>
Date: Thu, 25 Oct 2012 16:56:57 +0800
Local: Thurs, Oct 25 2012 4:56 am
Subject: Re: [node-webkit] Listen for url changes on opened windows?

On Thu, Oct 25, 2012 at 2:12 PM, Roger <wen...@gmail.com> wrote:
> On Thu, Oct 25, 2012 at 2:10 PM, Zhao Cheng <zcb...@gmail.com> wrote:

>> After the window has changed its URL, its javascript context will be
>> completely lost.

> Right. But the Node's context would not? So the code in Node context can
> do this job.

And that's why we need to fix #36 [1], which should be the only way to
define functions in Node context.

[1] https://github.com/rogerwang/node-webkit/issues/36

Roger


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
scottgmead...@gmail.com  
View profile  
 More options Oct 29 2012, 5:51 am
From: scottgmead...@gmail.com
Date: Mon, 29 Oct 2012 02:51:10 -0700 (PDT)
Local: Mon, Oct 29 2012 5:51 am
Subject: Re: [node-webkit] Listen for url changes on opened windows?

Now that the #36 fix is in, I'm curious about how I would do this properly.

Have tried the following code window api code in app.js which is defined as
node-main in the manifest.

<code>
var gui = require('nw.gui');
var newWindow = gui.Window.get(

window.open('http://google.ca');

)
</code>

This seems to throw an error (the nw ui just goes grey). Is this a bug or
am I doing something wrong?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger WANG  
View profile  
 More options Oct 29 2012, 10:18 am
From: Roger WANG <roger.w...@intel.com>
Date: Mon, 29 Oct 2012 22:17:58 +0800
Local: Mon, Oct 29 2012 10:17 am
Subject: Re: [node-webkit] Listen for url changes on opened windows?

<scottgmead...@gmail.com> writes:
> Now that the #36 fix is in, I'm curious about how I would do this
> properly.

At least in my testing the fix didn't work. Will re-open the issue and
follow up on this.

> Have tried the following code window api code in app.js which is defined as
> node-main in the manifest.

> <code>
> var gui = require('nw.gui');
> var newWindow = gui.Window.get(

> window.open('http://google.ca');

> )
> </code>

> This seems to throw an error (the nw ui just goes grey). Is this a bug or
> am I doing something wrong?

Even after #36 works, 'nw.gui' and windows objects cannot be opened
here (which should be another item on our TODO).

A callback function should be defined here and then referred from
WebKit context (e.g. from your index.html)

--
Roger WANG                         Intel Open Source Technology Center


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
scottgmead...@gmail.com  
View profile  
 More options Oct 29 2012, 8:02 pm
From: scottgmead...@gmail.com
Date: Mon, 29 Oct 2012 17:02:58 -0700 (PDT)
Local: Mon, Oct 29 2012 8:02 pm
Subject: Re: [node-webkit] Listen for url changes on opened windows?

Opened issue #128 <https://github.com/rogerwang/node-webkit/issues/128>.

Roger, thanks for the quick reply and your continued hard work on
node-webkit.

Let me give some context to my question here... I'm working on an
application that will use node-webkit as a browser for the web at large
with some added node functionality in the background, so access to
index.html is a bit tricky to say the least.

Is this kind of project 'in scope' for nw?

Cheers!
-Scott


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger  
View profile  
 More options Oct 29 2012, 8:08 pm
From: Roger <wen...@gmail.com>
Date: Tue, 30 Oct 2012 08:08:07 +0800
Local: Mon, Oct 29 2012 8:08 pm
Subject: Re: [node-webkit] Listen for url changes on opened windows?

Sure it is in our scope.

Roger


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Roger WANG  
View profile  
 More options Jan 14, 10:38 am
From: Roger WANG <roger.w...@intel.com>
Date: Mon, 14 Jan 2013 23:38:10 +0800
Local: Mon, Jan 14 2013 10:38 am
Subject: Re: [node-webkit] Listen for url changes on opened windows?

Roger WANG <roger.w...@intel.com> writes:
> <scottgmead...@gmail.com> writes:

>> Now that the #36 fix is in, I'm curious about how I would do this
>> properly.

> At least in my testing the fix didn't work. Will re-open the issue and
> follow up on this.

Just had a try and it's working with 'loaded' event on the Window
object:

https://github.com/rogerwang/node-webkit/wiki/Window

You can use it from Node context:

    var gui = window.require('nw.gui');
    gui.Window.get(win).on('loaded', function() {
    window.console.log(window.location.href); });

--
Roger WANG                     Intel Open Source Technology Center


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »