Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
In the below code i use aWebProgress to and then GetDOMWindow on that,
however GetDOMWindow only allows nsIDOMWindow, would the QueryInterface
accommodate for this for this

NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
aWebProgress,
nsIRequest* aRequest,
nsIURI *location,
uint32_t aFlags)
{
PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
if (aWebProgress) {
nsCOMPtr  domWindow;
nsCOMPtr  topDomWindow;
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
if (domWindow) { // Get root domWindow
domWindow->GetTop(getter_AddRefs(topDomWindow));
}
if (domWindow != topDomWindow)
isSubFrameLoad = PR_TRUE;
}
if (!isSubFrameLoad)
CWebBrowserChromeUI::UpdateCurrentURI(this);
return NS_OK;
}

On Wed, Feb 10, 2016 at 8:30 PM, Kyle Huey  wrote:

> Yes, SizeToContent is only accessible to JS now.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 5:28 PM, Devan Shah 
> wrote:
>
>> yep
>>
>> This is how I was using nsIDOMWindow before:
>>
>> NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
>> aWebProgress,
>> nsIRequest* aRequest,
>> nsIURI *location,
>> uint32_t aFlags)
>> {
>> PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
>> if (aWebProgress) {
>> nsCOMPtr  domWindow;
>> nsCOMPtr  topDomWindow;
>> aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
>> if (domWindow) { // Get root domWindow
>> domWindow->GetTop(getter_AddRefs(topDomWindow));
>> }
>> if (domWindow != topDomWindow)
>> isSubFrameLoad = PR_TRUE;
>> }
>> if (!isSubFrameLoad)
>> CWebBrowserChromeUI::UpdateCurrentURI(this);
>> return NS_OK;
>> }
>>
>> So here just changing nsCOMPtr to nsCOMPtr
>> and using QueryInterface should do the trick right?
>>
>> Also I am using a function called SizeToContent() from nsIDOMWindow which
>> I do not see exists any more in nsPIDOMWindow either was this one removed
>> completly.
>>
>> On Wed, Feb 10, 2016 at 8:24 PM, Kyle Huey  wrote:
>>
>>> Right, that will work, although you could nsCOMPtr to make it a lot
>>> prettier:
>>>
>>> void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
>>> {
>>>   nsCOMPtr window = do_QueryInterface(aDOMWindow);
>>>   nsCOMPtr docShell;
>>>   if (window)
>>> window->GetDocShell(getter_AddRefs(docShell));
>>>   nsIWebShell* rootWebShell = 0;
>>>   NS_IF_RELEASE(rootWebShell);
>>> //return status;
>>> }
>>>
>>> - Kyle
>>>
>>> On Wed, Feb 10, 2016 at 5:22 PM, Devan Shah 
>>> wrote:
>>>
 Do you happen to have a QueryInterface example,

 Would something like the following work:

 void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
 {
   nsPIDOMWindow* window = 0;
   nsresult status =
 aDOMWindow->QueryInterface(NS_GET_IID(nsPIDOMWindow), (void**));
   nsIDocShell* docShell = 0;
   if (window)
 window->GetDocShell();
   nsIWebShell* rootWebShell = 0;
   NS_IF_RELEASE(rootWebShell);
   NS_IF_RELEASE(docShell);
   NS_IF_RELEASE(window);
 //return status;
 }

 On Wed, Feb 10, 2016 at 8:16 PM, Kyle Huey  wrote:

> Alright, just QueryInterface between nsIDOMWindow and nsPIDOMWindow
> when you have one and need the other and you should be fine.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 5:15 PM, Devan Shah 
> wrote:
>
>> Currently I just want to get it up and running again on FF 45 again,
>> with out making too much changes because we plan to deprecate this 
>> feature
>> mid this year or so.
>>
>> Just need to get it working on Firefox 45, currently works perfectly
>> on Firefox 38.
>>
>>
>

>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
I am using it from c++

On Wed, Feb 10, 2016 at 7:38 PM, Kyle Huey  wrote:

> Are you using it from JS or C++?  If you're using it from JS, nothing has
> changed.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 4:32 PM, Devan Shah 
> wrote:
>
>> Hello
>>
>> nsIDOMWindow is deprecated now according to:
>> https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow
>> is there an alternative for this interface. I am using a lot of functions
>> from this interface and also using nsIPromptFactory which relies on
>> nsIDOMWindow a lot for all of it functions.
>>
>> Is there any way to get an alternative with the same functionality which
>> requires minimal changes or is there a way that I can get the nsIDOMWindow
>> interface and all of its functionality back by adding the interface locally
>> and implementing the functions locally.
>>
>> Thanks
>> Devan Shah
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-platform
>>
>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
I was using the xulrunner SDK, but that is no longer created any more so
using the firefox SDK.

I am using it to create a plugin which can be used to launch a web browser
which communicates with a proxy server which can be used to capture all the
http traffic.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
Do you happen to have a QueryInterface example,

Would something like the following work:

void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
{
  nsPIDOMWindow* window = 0;
  nsresult status = aDOMWindow->QueryInterface(NS_GET_IID(nsPIDOMWindow),
(void**));
  nsIDocShell* docShell = 0;
  if (window)
window->GetDocShell();
  nsIWebShell* rootWebShell = 0;
  NS_IF_RELEASE(rootWebShell);
  NS_IF_RELEASE(docShell);
  NS_IF_RELEASE(window);
//return status;
}

On Wed, Feb 10, 2016 at 8:16 PM, Kyle Huey  wrote:

> Alright, just QueryInterface between nsIDOMWindow and nsPIDOMWindow when
> you have one and need the other and you should be fine.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 5:15 PM, Devan Shah 
> wrote:
>
>> Currently I just want to get it up and running again on FF 45 again, with
>> out making too much changes because we plan to deprecate this feature mid
>> this year or so.
>>
>> Just need to get it working on Firefox 45, currently works perfectly on
>> Firefox 38.
>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
Currently I just want to get it up and running again on FF 45 again, with
out making too much changes because we plan to deprecate this feature mid
this year or so.

Just need to get it working on Firefox 45, currently works perfectly on
Firefox 38.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
I tried to use nsPIDOMWindow, but issues is that functions like:

Function GetContentDOMWindow in nsIWebBrowser is expecting: NS_IMETHOD
GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) = 0;
(firefox-45.0b4\firefox-sdk\include\nsIWebBrowser.h)
Function: NS_IMETHOD GetPrompt(nsIDOMWindow *aParent, const nsIID & iid,
void **result) = 0; from nsIPromptFactory

So makes it all not compatible.

Is there any way I can rebuild the Firefox SDK with the old nsIDOMWindow

On Wed, Feb 10, 2016 at 7:51 PM, Kyle Huey  wrote:

> Yeah, ok, nsPIDOMWindow then.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 4:49 PM, Devan Shah 
> wrote:
>
>> Version 45, I am using the SDK from
>> https://ftp.mozilla.org/pub/firefox/releases/45.0b4/win32/en-US/firefox-45.0b4.sdk.zip.
>> Which I still see the nsIPromptFactory has
>>
>>   /* void getPrompt (in nsIDOMWindow aParent, in nsIIDRef iid, [iid_is
>> (iid), retval] out nsQIResult result); */
>>   NS_IMETHOD GetPrompt(nsIDOMWindow *aParent, const nsIID & iid, void
>> **result) = 0;
>>
>>
>>
>> 
>>
>> On Wed, Feb 10, 2016 at 7:43 PM, Kyle Huey  wrote:
>>
>>> Ok ... ignoring the question of how you're using it from C++ since
>>> binary addons are gone, many of the methods on nsIDOMWindow moved to
>>> nsPIDOMWindow and then to nsPIDOMWindowInner/Outer, depending on what
>>> version of Gecko you're using.  Today on trunk nsIPromptFactory takes a
>>> mozIDOMWindowProxy, which is a base interface of nsPIDOMWindowOuter.  You
>>> can look at
>>> http://mxr.mozilla.org/mozilla-central/source/dom/base/nsPIDOMWindow.h
>>> to see what's there.  Some methods on nsIDOMWindow that were unused were
>>> removed completely, though I don't think there were many.
>>>
>>> - Kyle
>>>
>>> On Wed, Feb 10, 2016 at 4:40 PM, Devan Shah 
>>> wrote:
>>>
 I am using it from c++

 On Wed, Feb 10, 2016 at 7:38 PM, Kyle Huey  wrote:

> Are you using it from JS or C++?  If you're using it from JS, nothing
> has changed.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 4:32 PM, Devan Shah 
> wrote:
>
>> Hello
>>
>> nsIDOMWindow is deprecated now according to:
>> https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow
>> is there an alternative for this interface. I am using a lot of functions
>> from this interface and also using nsIPromptFactory which relies on
>> nsIDOMWindow a lot for all of it functions.
>>
>> Is there any way to get an alternative with the same functionality
>> which requires minimal changes or is there a way that I can get the
>> nsIDOMWindow interface and all of its functionality back by adding the
>> interface locally and implementing the functions locally.
>>
>> Thanks
>> Devan Shah
>> ___
>> dev-platform mailing list
>> dev-platform@lists.mozilla.org
>> https://lists.mozilla.org/listinfo/dev-platform
>>
>
>

>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
So Something like:

NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
aWebProgress,
nsIRequest* aRequest,
nsIURI *location,
uint32_t aFlags)
{
PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
if (aWebProgress) {
nsCOMPtr  domWindow;
nsCOMPtr  topDomWindow;
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
if (domWindow) { // Get root domWindow
topDomWindow = do_QueryInterface(domWindow);
topDomWindow->GetTop();
}
if (domWindow != topDomWindow)
isSubFrameLoad = PR_TRUE;
}
if (!isSubFrameLoad)
CWebBrowserChromeUI::UpdateCurrentURI(this);
return NS_OK;
}

On Wed, Feb 10, 2016 at 8:37 PM, Kyle Huey  wrote:

> You get the nsIDOMWindow, and then QueryInterface to nsPIDOMWindow to call
> GetTop on it.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 5:35 PM, Devan Shah 
> wrote:
>
>> In the below code i use aWebProgress to and then GetDOMWindow on that,
>> however GetDOMWindow only allows nsIDOMWindow, would the QueryInterface
>> accommodate for this for this
>>
>> NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
>> aWebProgress,
>> nsIRequest* aRequest,
>> nsIURI *location,
>> uint32_t aFlags)
>> {
>> PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
>> if (aWebProgress) {
>> nsCOMPtr  domWindow;
>> nsCOMPtr  topDomWindow;
>> aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
>> if (domWindow) { // Get root domWindow
>> domWindow->GetTop(getter_AddRefs(topDomWindow));
>> }
>> if (domWindow != topDomWindow)
>> isSubFrameLoad = PR_TRUE;
>> }
>> if (!isSubFrameLoad)
>> CWebBrowserChromeUI::UpdateCurrentURI(this);
>> return NS_OK;
>> }
>>
>> On Wed, Feb 10, 2016 at 8:30 PM, Kyle Huey  wrote:
>>
>>> Yes, SizeToContent is only accessible to JS now.
>>>
>>> - Kyle
>>>
>>> On Wed, Feb 10, 2016 at 5:28 PM, Devan Shah 
>>> wrote:
>>>
 yep

 This is how I was using nsIDOMWindow before:

 NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
 aWebProgress,
 nsIRequest* aRequest,
 nsIURI *location,
 uint32_t aFlags)
 {
 PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
 if (aWebProgress) {
 nsCOMPtr  domWindow;
 nsCOMPtr  topDomWindow;
 aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
 if (domWindow) { // Get root domWindow
 domWindow->GetTop(getter_AddRefs(topDomWindow));
 }
 if (domWindow != topDomWindow)
 isSubFrameLoad = PR_TRUE;
 }
 if (!isSubFrameLoad)
 CWebBrowserChromeUI::UpdateCurrentURI(this);
 return NS_OK;
 }

 So here just changing nsCOMPtr to nsCOMPtr
 and using QueryInterface should do the trick right?

 Also I am using a function called SizeToContent() from nsIDOMWindow
 which I do not see exists any more in nsPIDOMWindow either was this one
 removed completly.

 On Wed, Feb 10, 2016 at 8:24 PM, Kyle Huey  wrote:

> Right, that will work, although you could nsCOMPtr to make it a lot
> prettier:
>
> void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
> {
>   nsCOMPtr window = do_QueryInterface(aDOMWindow);
>   nsCOMPtr docShell;
>   if (window)
> window->GetDocShell(getter_AddRefs(docShell));
>   nsIWebShell* rootWebShell = 0;
>   NS_IF_RELEASE(rootWebShell);
> //return status;
> }
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 5:22 PM, Devan Shah 
> wrote:
>
>> Do you happen to have a QueryInterface example,
>>
>> Would something like the following work:
>>
>> void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
>> {
>>   nsPIDOMWindow* window = 0;
>>   nsresult status =
>> aDOMWindow->QueryInterface(NS_GET_IID(nsPIDOMWindow), (void**));
>>   nsIDocShell* docShell = 0;
>>   if (window)
>> window->GetDocShell();
>>   nsIWebShell* rootWebShell = 0;
>>   NS_IF_RELEASE(rootWebShell);
>>   NS_IF_RELEASE(docShell);
>>   NS_IF_RELEASE(window);
>> //return status;
>> }
>>
>> On Wed, Feb 10, 2016 at 8:16 PM, Kyle Huey  wrote:
>>
>>> Alright, just QueryInterface between nsIDOMWindow and nsPIDOMWindow
>>> when you have one and need the other and you should be fine.
>>>
>>> - Kyle
>>>
>>> On Wed, Feb 10, 2016 at 5:15 PM, Devan Shah 
>>> wrote:
>>>
 Currently I just want to get it up and running again on FF 45
 again, with out making too much changes because 

Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
yep

This is how I was using nsIDOMWindow before:

NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
aWebProgress,
nsIRequest* aRequest,
nsIURI *location,
uint32_t aFlags)
{
PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
if (aWebProgress) {
nsCOMPtr  domWindow;
nsCOMPtr  topDomWindow;
aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
if (domWindow) { // Get root domWindow
domWindow->GetTop(getter_AddRefs(topDomWindow));
}
if (domWindow != topDomWindow)
isSubFrameLoad = PR_TRUE;
}
if (!isSubFrameLoad)
CWebBrowserChromeUI::UpdateCurrentURI(this);
return NS_OK;
}

So here just changing nsCOMPtr to nsCOMPtr and
using QueryInterface should do the trick right?

Also I am using a function called SizeToContent() from nsIDOMWindow which I
do not see exists any more in nsPIDOMWindow either was this one removed
completly.

On Wed, Feb 10, 2016 at 8:24 PM, Kyle Huey  wrote:

> Right, that will work, although you could nsCOMPtr to make it a lot
> prettier:
>
> void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
> {
>   nsCOMPtr window = do_QueryInterface(aDOMWindow);
>   nsCOMPtr docShell;
>   if (window)
> window->GetDocShell(getter_AddRefs(docShell));
>   nsIWebShell* rootWebShell = 0;
>   NS_IF_RELEASE(rootWebShell);
> //return status;
> }
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 5:22 PM, Devan Shah 
> wrote:
>
>> Do you happen to have a QueryInterface example,
>>
>> Would something like the following work:
>>
>> void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
>> {
>>   nsPIDOMWindow* window = 0;
>>   nsresult status = aDOMWindow->QueryInterface(NS_GET_IID(nsPIDOMWindow),
>> (void**));
>>   nsIDocShell* docShell = 0;
>>   if (window)
>> window->GetDocShell();
>>   nsIWebShell* rootWebShell = 0;
>>   NS_IF_RELEASE(rootWebShell);
>>   NS_IF_RELEASE(docShell);
>>   NS_IF_RELEASE(window);
>> //return status;
>> }
>>
>> On Wed, Feb 10, 2016 at 8:16 PM, Kyle Huey  wrote:
>>
>>> Alright, just QueryInterface between nsIDOMWindow and nsPIDOMWindow when
>>> you have one and need the other and you should be fine.
>>>
>>> - Kyle
>>>
>>> On Wed, Feb 10, 2016 at 5:15 PM, Devan Shah 
>>> wrote:
>>>
 Currently I just want to get it up and running again on FF 45 again,
 with out making too much changes because we plan to deprecate this feature
 mid this year or so.

 Just need to get it working on Firefox 45, currently works perfectly on
 Firefox 38.


>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-11 Thread Devan Shah
Version 45, I am using the SDK from
https://ftp.mozilla.org/pub/firefox/releases/45.0b4/win32/en-US/firefox-45.0b4.sdk.zip.
Which I still see the nsIPromptFactory has

  /* void getPrompt (in nsIDOMWindow aParent, in nsIIDRef iid, [iid_is
(iid), retval] out nsQIResult result); */
  NS_IMETHOD GetPrompt(nsIDOMWindow *aParent, const nsIID & iid, void
**result) = 0;




On Wed, Feb 10, 2016 at 7:43 PM, Kyle Huey  wrote:

> Ok ... ignoring the question of how you're using it from C++ since binary
> addons are gone, many of the methods on nsIDOMWindow moved to nsPIDOMWindow
> and then to nsPIDOMWindowInner/Outer, depending on what version of Gecko
> you're using.  Today on trunk nsIPromptFactory takes a mozIDOMWindowProxy,
> which is a base interface of nsPIDOMWindowOuter.  You can look at
> http://mxr.mozilla.org/mozilla-central/source/dom/base/nsPIDOMWindow.h to
> see what's there.  Some methods on nsIDOMWindow that were unused were
> removed completely, though I don't think there were many.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 4:40 PM, Devan Shah 
> wrote:
>
>> I am using it from c++
>>
>> On Wed, Feb 10, 2016 at 7:38 PM, Kyle Huey  wrote:
>>
>>> Are you using it from JS or C++?  If you're using it from JS, nothing
>>> has changed.
>>>
>>> - Kyle
>>>
>>> On Wed, Feb 10, 2016 at 4:32 PM, Devan Shah 
>>> wrote:
>>>
 Hello

 nsIDOMWindow is deprecated now according to:
 https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow
 is there an alternative for this interface. I am using a lot of functions
 from this interface and also using nsIPromptFactory which relies on
 nsIDOMWindow a lot for all of it functions.

 Is there any way to get an alternative with the same functionality
 which requires minimal changes or is there a way that I can get the
 nsIDOMWindow interface and all of its functionality back by adding the
 interface locally and implementing the functions locally.

 Thanks
 Devan Shah
 ___
 dev-platform mailing list
 dev-platform@lists.mozilla.org
 https://lists.mozilla.org/listinfo/dev-platform

>>>
>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
Are you using it from JS or C++?  If you're using it from JS, nothing has
changed.

- Kyle

On Wed, Feb 10, 2016 at 4:32 PM, Devan Shah  wrote:

> Hello
>
> nsIDOMWindow is deprecated now according to:
> https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow
> is there an alternative for this interface. I am using a lot of functions
> from this interface and also using nsIPromptFactory which relies on
> nsIDOMWindow a lot for all of it functions.
>
> Is there any way to get an alternative with the same functionality which
> requires minimal changes or is there a way that I can get the nsIDOMWindow
> interface and all of its functionality back by adding the interface locally
> and implementing the functions locally.
>
> Thanks
> Devan Shah
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
Ok ... ignoring the question of how you're using it from C++ since binary
addons are gone, many of the methods on nsIDOMWindow moved to nsPIDOMWindow
and then to nsPIDOMWindowInner/Outer, depending on what version of Gecko
you're using.  Today on trunk nsIPromptFactory takes a mozIDOMWindowProxy,
which is a base interface of nsPIDOMWindowOuter.  You can look at
http://mxr.mozilla.org/mozilla-central/source/dom/base/nsPIDOMWindow.h to
see what's there.  Some methods on nsIDOMWindow that were unused were
removed completely, though I don't think there were many.

- Kyle

On Wed, Feb 10, 2016 at 4:40 PM, Devan Shah  wrote:

> I am using it from c++
>
> On Wed, Feb 10, 2016 at 7:38 PM, Kyle Huey  wrote:
>
>> Are you using it from JS or C++?  If you're using it from JS, nothing has
>> changed.
>>
>> - Kyle
>>
>> On Wed, Feb 10, 2016 at 4:32 PM, Devan Shah 
>> wrote:
>>
>>> Hello
>>>
>>> nsIDOMWindow is deprecated now according to:
>>> https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow
>>> is there an alternative for this interface. I am using a lot of functions
>>> from this interface and also using nsIPromptFactory which relies on
>>> nsIDOMWindow a lot for all of it functions.
>>>
>>> Is there any way to get an alternative with the same functionality which
>>> requires minimal changes or is there a way that I can get the nsIDOMWindow
>>> interface and all of its functionality back by adding the interface locally
>>> and implementing the functions locally.
>>>
>>> Thanks
>>> Devan Shah
>>> ___
>>> dev-platform mailing list
>>> dev-platform@lists.mozilla.org
>>> https://lists.mozilla.org/listinfo/dev-platform
>>>
>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
Yes, you need to QueryInterface between nsIDOMWindow and nsPIDOMWindow.

What are you actually doing with the Firefox SDK?

- Kyle

On Wed, Feb 10, 2016 at 5:03 PM, Devan Shah  wrote:

> I tried to use nsPIDOMWindow, but issues is that functions like:
>
> Function GetContentDOMWindow in nsIWebBrowser is expecting: NS_IMETHOD
> GetContentDOMWindow(nsIDOMWindow * *aContentDOMWindow) = 0;
> (firefox-45.0b4\firefox-sdk\include\nsIWebBrowser.h)
> Function: NS_IMETHOD GetPrompt(nsIDOMWindow *aParent, const nsIID & iid,
> void **result) = 0; from nsIPromptFactory
>
> So makes it all not compatible.
>
> Is there any way I can rebuild the Firefox SDK with the old nsIDOMWindow
>
> On Wed, Feb 10, 2016 at 7:51 PM, Kyle Huey  wrote:
>
>> Yeah, ok, nsPIDOMWindow then.
>>
>> - Kyle
>>
>> On Wed, Feb 10, 2016 at 4:49 PM, Devan Shah 
>> wrote:
>>
>>> Version 45, I am using the SDK from
>>> https://ftp.mozilla.org/pub/firefox/releases/45.0b4/win32/en-US/firefox-45.0b4.sdk.zip.
>>> Which I still see the nsIPromptFactory has
>>>
>>>   /* void getPrompt (in nsIDOMWindow aParent, in nsIIDRef iid, [iid_is
>>> (iid), retval] out nsQIResult result); */
>>>   NS_IMETHOD GetPrompt(nsIDOMWindow *aParent, const nsIID & iid, void
>>> **result) = 0;
>>>
>>>
>>>
>>> 
>>>
>>> On Wed, Feb 10, 2016 at 7:43 PM, Kyle Huey  wrote:
>>>
 Ok ... ignoring the question of how you're using it from C++ since
 binary addons are gone, many of the methods on nsIDOMWindow moved to
 nsPIDOMWindow and then to nsPIDOMWindowInner/Outer, depending on what
 version of Gecko you're using.  Today on trunk nsIPromptFactory takes a
 mozIDOMWindowProxy, which is a base interface of nsPIDOMWindowOuter.  You
 can look at
 http://mxr.mozilla.org/mozilla-central/source/dom/base/nsPIDOMWindow.h
 to see what's there.  Some methods on nsIDOMWindow that were unused were
 removed completely, though I don't think there were many.

 - Kyle

 On Wed, Feb 10, 2016 at 4:40 PM, Devan Shah 
 wrote:

> I am using it from c++
>
> On Wed, Feb 10, 2016 at 7:38 PM, Kyle Huey  wrote:
>
>> Are you using it from JS or C++?  If you're using it from JS, nothing
>> has changed.
>>
>> - Kyle
>>
>> On Wed, Feb 10, 2016 at 4:32 PM, Devan Shah 
>> wrote:
>>
>>> Hello
>>>
>>> nsIDOMWindow is deprecated now according to:
>>> https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow
>>> is there an alternative for this interface. I am using a lot of 
>>> functions
>>> from this interface and also using nsIPromptFactory which relies on
>>> nsIDOMWindow a lot for all of it functions.
>>>
>>> Is there any way to get an alternative with the same functionality
>>> which requires minimal changes or is there a way that I can get the
>>> nsIDOMWindow interface and all of its functionality back by adding the
>>> interface locally and implementing the functions locally.
>>>
>>> Thanks
>>> Devan Shah
>>> ___
>>> dev-platform mailing list
>>> dev-platform@lists.mozilla.org
>>> https://lists.mozilla.org/listinfo/dev-platform
>>>
>>
>>
>

>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
Right, that will work, although you could nsCOMPtr to make it a lot
prettier:

void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
{
  nsCOMPtr window = do_QueryInterface(aDOMWindow);
  nsCOMPtr docShell;
  if (window)
window->GetDocShell(getter_AddRefs(docShell));
  nsIWebShell* rootWebShell = 0;
  NS_IF_RELEASE(rootWebShell);
//return status;
}

- Kyle

On Wed, Feb 10, 2016 at 5:22 PM, Devan Shah  wrote:

> Do you happen to have a QueryInterface example,
>
> Would something like the following work:
>
> void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
> {
>   nsPIDOMWindow* window = 0;
>   nsresult status = aDOMWindow->QueryInterface(NS_GET_IID(nsPIDOMWindow),
> (void**));
>   nsIDocShell* docShell = 0;
>   if (window)
> window->GetDocShell();
>   nsIWebShell* rootWebShell = 0;
>   NS_IF_RELEASE(rootWebShell);
>   NS_IF_RELEASE(docShell);
>   NS_IF_RELEASE(window);
> //return status;
> }
>
> On Wed, Feb 10, 2016 at 8:16 PM, Kyle Huey  wrote:
>
>> Alright, just QueryInterface between nsIDOMWindow and nsPIDOMWindow when
>> you have one and need the other and you should be fine.
>>
>> - Kyle
>>
>> On Wed, Feb 10, 2016 at 5:15 PM, Devan Shah 
>> wrote:
>>
>>> Currently I just want to get it up and running again on FF 45 again,
>>> with out making too much changes because we plan to deprecate this feature
>>> mid this year or so.
>>>
>>> Just need to get it working on Firefox 45, currently works perfectly on
>>> Firefox 38.
>>>
>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Dave Townsend
Yeah, Firefox 41 and later don't support binary XPCOM components in
extensions. ctypes is still supported and so are binary plugins.

On Wed, Feb 10, 2016 at 5:12 PM, Kyle Huey  wrote:
> Ok.  I thought we killed binary components in extensions ...
>
> There will be a lot of changes around windows and their XPIDL interfaces in
> Gecko over the next while so you should expect to have to update this code
> fairly frequently if you're actually calling methods on nsIDOMWindow.
>
> - Kyle
>
> On Wed, Feb 10, 2016 at 5:10 PM, Devan Shah  wrote:
>
>> I was using the xulrunner SDK, but that is no longer created any more so
>> using the firefox SDK.
>>
>> I am using it to create a plugin which can be used to launch a web browser
>> which communicates with a proxy server which can be used to capture all the
>> http traffic.
>>
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
Yeah, ok, nsPIDOMWindow then.

- Kyle

On Wed, Feb 10, 2016 at 4:49 PM, Devan Shah  wrote:

> Version 45, I am using the SDK from
> https://ftp.mozilla.org/pub/firefox/releases/45.0b4/win32/en-US/firefox-45.0b4.sdk.zip.
> Which I still see the nsIPromptFactory has
>
>   /* void getPrompt (in nsIDOMWindow aParent, in nsIIDRef iid, [iid_is
> (iid), retval] out nsQIResult result); */
>   NS_IMETHOD GetPrompt(nsIDOMWindow *aParent, const nsIID & iid, void
> **result) = 0;
>
>
>
> 
>
> On Wed, Feb 10, 2016 at 7:43 PM, Kyle Huey  wrote:
>
>> Ok ... ignoring the question of how you're using it from C++ since binary
>> addons are gone, many of the methods on nsIDOMWindow moved to nsPIDOMWindow
>> and then to nsPIDOMWindowInner/Outer, depending on what version of Gecko
>> you're using.  Today on trunk nsIPromptFactory takes a mozIDOMWindowProxy,
>> which is a base interface of nsPIDOMWindowOuter.  You can look at
>> http://mxr.mozilla.org/mozilla-central/source/dom/base/nsPIDOMWindow.h
>> to see what's there.  Some methods on nsIDOMWindow that were unused were
>> removed completely, though I don't think there were many.
>>
>> - Kyle
>>
>> On Wed, Feb 10, 2016 at 4:40 PM, Devan Shah 
>> wrote:
>>
>>> I am using it from c++
>>>
>>> On Wed, Feb 10, 2016 at 7:38 PM, Kyle Huey  wrote:
>>>
 Are you using it from JS or C++?  If you're using it from JS, nothing
 has changed.

 - Kyle

 On Wed, Feb 10, 2016 at 4:32 PM, Devan Shah 
 wrote:

> Hello
>
> nsIDOMWindow is deprecated now according to:
> https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsIDOMWindow
> is there an alternative for this interface. I am using a lot of functions
> from this interface and also using nsIPromptFactory which relies on
> nsIDOMWindow a lot for all of it functions.
>
> Is there any way to get an alternative with the same functionality
> which requires minimal changes or is there a way that I can get the
> nsIDOMWindow interface and all of its functionality back by adding the
> interface locally and implementing the functions locally.
>
> Thanks
> Devan Shah
> ___
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-platform
>


>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
Ok.  I thought we killed binary components in extensions ...

There will be a lot of changes around windows and their XPIDL interfaces in
Gecko over the next while so you should expect to have to update this code
fairly frequently if you're actually calling methods on nsIDOMWindow.

- Kyle

On Wed, Feb 10, 2016 at 5:10 PM, Devan Shah  wrote:

> I was using the xulrunner SDK, but that is no longer created any more so
> using the firefox SDK.
>
> I am using it to create a plugin which can be used to launch a web browser
> which communicates with a proxy server which can be used to capture all the
> http traffic.
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
Alright, just QueryInterface between nsIDOMWindow and nsPIDOMWindow when
you have one and need the other and you should be fine.

- Kyle

On Wed, Feb 10, 2016 at 5:15 PM, Devan Shah  wrote:

> Currently I just want to get it up and running again on FF 45 again, with
> out making too much changes because we plan to deprecate this feature mid
> this year or so.
>
> Just need to get it working on Firefox 45, currently works perfectly on
> Firefox 38.
>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: nsIDOMWindow is deprecated now is there an alternative?

2016-02-10 Thread Kyle Huey
You get the nsIDOMWindow, and then QueryInterface to nsPIDOMWindow to call
GetTop on it.

- Kyle

On Wed, Feb 10, 2016 at 5:35 PM, Devan Shah  wrote:

> In the below code i use aWebProgress to and then GetDOMWindow on that,
> however GetDOMWindow only allows nsIDOMWindow, would the QueryInterface
> accommodate for this for this
>
> NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
> aWebProgress,
> nsIRequest* aRequest,
> nsIURI *location,
> uint32_t aFlags)
> {
> PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
> if (aWebProgress) {
> nsCOMPtr  domWindow;
> nsCOMPtr  topDomWindow;
> aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
> if (domWindow) { // Get root domWindow
> domWindow->GetTop(getter_AddRefs(topDomWindow));
> }
> if (domWindow != topDomWindow)
> isSubFrameLoad = PR_TRUE;
> }
> if (!isSubFrameLoad)
> CWebBrowserChromeUI::UpdateCurrentURI(this);
> return NS_OK;
> }
>
> On Wed, Feb 10, 2016 at 8:30 PM, Kyle Huey  wrote:
>
>> Yes, SizeToContent is only accessible to JS now.
>>
>> - Kyle
>>
>> On Wed, Feb 10, 2016 at 5:28 PM, Devan Shah 
>> wrote:
>>
>>> yep
>>>
>>> This is how I was using nsIDOMWindow before:
>>>
>>> NS_IMETHODIMP WebBrowserChrome::OnLocationChange(nsIWebProgress*
>>> aWebProgress,
>>> nsIRequest* aRequest,
>>> nsIURI *location,
>>> uint32_t aFlags)
>>> {
>>> PRBool isSubFrameLoad = PR_FALSE; // Is this a subframe load
>>> if (aWebProgress) {
>>> nsCOMPtr  domWindow;
>>> nsCOMPtr  topDomWindow;
>>> aWebProgress->GetDOMWindow(getter_AddRefs(domWindow));
>>> if (domWindow) { // Get root domWindow
>>> domWindow->GetTop(getter_AddRefs(topDomWindow));
>>> }
>>> if (domWindow != topDomWindow)
>>> isSubFrameLoad = PR_TRUE;
>>> }
>>> if (!isSubFrameLoad)
>>> CWebBrowserChromeUI::UpdateCurrentURI(this);
>>> return NS_OK;
>>> }
>>>
>>> So here just changing nsCOMPtr to nsCOMPtr
>>> and using QueryInterface should do the trick right?
>>>
>>> Also I am using a function called SizeToContent() from nsIDOMWindow
>>> which I do not see exists any more in nsPIDOMWindow either was this one
>>> removed completly.
>>>
>>> On Wed, Feb 10, 2016 at 8:24 PM, Kyle Huey  wrote:
>>>
 Right, that will work, although you could nsCOMPtr to make it a lot
 prettier:

 void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
 {
   nsCOMPtr window = do_QueryInterface(aDOMWindow);
   nsCOMPtr docShell;
   if (window)
 window->GetDocShell(getter_AddRefs(docShell));
   nsIWebShell* rootWebShell = 0;
   NS_IF_RELEASE(rootWebShell);
 //return status;
 }

 - Kyle

 On Wed, Feb 10, 2016 at 5:22 PM, Devan Shah 
 wrote:

> Do you happen to have a QueryInterface example,
>
> Would something like the following work:
>
> void test(nsIDOMWindow* aDOMWindow, nsIBaseWindow** aBaseWindow)
> {
>   nsPIDOMWindow* window = 0;
>   nsresult status =
> aDOMWindow->QueryInterface(NS_GET_IID(nsPIDOMWindow), (void**));
>   nsIDocShell* docShell = 0;
>   if (window)
> window->GetDocShell();
>   nsIWebShell* rootWebShell = 0;
>   NS_IF_RELEASE(rootWebShell);
>   NS_IF_RELEASE(docShell);
>   NS_IF_RELEASE(window);
> //return status;
> }
>
> On Wed, Feb 10, 2016 at 8:16 PM, Kyle Huey  wrote:
>
>> Alright, just QueryInterface between nsIDOMWindow and nsPIDOMWindow
>> when you have one and need the other and you should be fine.
>>
>> - Kyle
>>
>> On Wed, Feb 10, 2016 at 5:15 PM, Devan Shah 
>> wrote:
>>
>>> Currently I just want to get it up and running again on FF 45 again,
>>> with out making too much changes because we plan to deprecate this 
>>> feature
>>> mid this year or so.
>>>
>>> Just need to get it working on Firefox 45, currently works perfectly
>>> on Firefox 38.
>>>
>>>
>>
>

>>>
>>
>
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform