Question on window targeting and embedding

2005-11-14 Thread Boris Zbarsky
I've been trying to figure out a sane way to allow embeddors to do the "force 
windows to open in tabs" stuff that Firefox hacked in at some point.


The current state of things is described at 
http://wiki.mozilla.org/DocShell:Window_targeting and what I think we want to do 
is at .


I was wondering what people think of the suggestion.  I'm not sure whether a 
service is the right way to go or whether this is something that should live on 
the docshell tree owner... in particular, if we do a service-like thing then the 
callee will need to get from the nsIDOMWindow or nsIWebNavigation we pass in 
(one for some subframe) to something that would usefully allow them to open a 
tab in the same browser window, which might be nontrivial while sticking to 
frozen interfaces.


Thoughts?

-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to get the source for a webpage page using C/C++?

2005-11-14 Thread Boris Zbarsky

Stephen Kellett wrote:
That raises the question: When I do View Page Source from the View menu 
or the context menu how does it get the page source to display in the 
window?


It looks in the cache.  If it's not in the cache, it gets it from the network. 
There are some complications if POST data is involved, of course.


All I want to do is that. I don't know how to do that. Either it is 
refetched or it is in a local page-cache managed by Mozilla. I don't 
care where it is, just how to fetch it.


Unfortunately, the APIs for doing that are not really exposed...  You'd have to 
effectively do what nsDocShell::LoadHistoryEntry does.


-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to get the source for a webpage page using C/C++?

2005-11-14 Thread Stephen Kellett
In message <[EMAIL PROTECTED]>, Boris Zbarsky 
<[EMAIL PROTECTED]> writes

Stephen Kellett wrote:
Scenario: I'm in a JavaScript callback (for example the callHook 
callback) and I have a JSContext * and a JSScript at my disposal. How 
can I get the page source code for this page?


You can't, in general.


I'm not so sure. See below. I have the name of the page at my disposal.

However if its a non-local file such as 
http://someWebAddress/page.html  or one of the chrome:// pages then I 
can't open that. I don't want to fetch the page myself as the page 
content may be different for each call - I want the same source as the 
page which resulted in my script being called.


That may not be stored anywhere.


That raises the question: When I do View Page Source from the View menu 
or the context menu how does it get the page source to display in the 
window?


All I want to do is that. I don't know how to do that. Either it is 
refetched or it is in a local page-cache managed by Mozilla. I don't 
care where it is, just how to fetch it.


Stephen
--
Stephen Kellett
Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: How to get the source for a webpage page using C/C++?

2005-11-14 Thread Boris Zbarsky

Stephen Kellett wrote:
Scenario: I'm in a JavaScript callback (for example the callHook 
callback) and I have a JSContext * and a JSScript at my disposal. How 
can I get the page source code for this page?


You can't, in general.

However if its a non-local file such as http://someWebAddress/page.html 
or one of the chrome:// pages then I can't open that. I don't want to 
fetch the page myself as the page content may be different for each call 
- I want the same source as the page which resulted in my script being 
called.


That may not be stored anywhere.

-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


tab event handling in C++

2005-11-14 Thread Anatoly Kaverin

Greetings to everyone.

We're developing XPCOM C++ component which manipulates the data from loaded 
page into Firefox.

Now our task is to handle events when new TAB is created or closed.
Is there any interface (like nsIWebProgress) for capturing TAB events or 
is there another method how to handle tab event inside C++ component.


thnx for You attention.

With Best Regards,
Anatoly Kaverin, 
Firefox VEngine team

Comodo CA Limited
http://www.vengine.com http://www.comodo.com
[EMAIL PROTECTED]
MSN: [EMAIL PROTECTED]


___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


how to retrieve a IWebBrowser2 ?

2005-11-14 Thread toromanoff olivier

Hello!

I'm trying to let run an ActiveX plugin with Firefox.

I found and installed the Adam Lock's Plug-in for hosting ActiveX 
controls. Most of the plugin functionalities are now working well but 
not all.


Thus I'd like to send some javascript commands from the plugin to the 
browser. With IE, it worked fine by doing:


vClientSite.GetContainer(vContainer);
if vContainer.QueryInterface(IServiceProvider, vServiceProvider) = 
  	S_OK then
  if vServiceProvider.QueryService(IID_IWebBrowserApp,  
IID_IWebBrowser2, WB) = S_OK then

WB.Navigate('javascript:'+cmd, [...] );

with the following declarations:

  vClientSite  : IOLEClientSite;
  vContainer   : IOLEContainer;
  vServiceProvider : IServiceProvider;
  WB: IWebBrowser2;

But when the plugin is running with Firefox, the command 
vServiceProvider.QueryService returns the error code E_NOINTERFACE.


I m a newbie in this area and didn't achieve to find any clear and easy 
explanations on the web..


what can I do?

Thanks

Olivier, apologizing for the poor english.
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


How to get the source for a webpage page using C/C++?

2005-11-14 Thread Stephen Kellett

How to get the source for a webpage page using C/C++?

Scenario: I'm in a JavaScript callback (for example the callHook 
callback) and I have a JSContext * and a JSScript at my disposal. How 
can I get the page source code for this page?


One answer is get the filename from the script. That is great if its a 
local filename such as c:\myWebPage.html as I can open that using 
fopen() etc.


However if its a non-local file such as http://someWebAddress/page.html 
or one of the chrome:// pages then I can't open that. I don't want to 
fetch the page myself as the page content may be different for each call 
- I want the same source as the page which resulted in my script being 
called.


I've looked at the source for many days and weeks and this has defeated 
me. None of the JSD_* calls appear to be publicly available as DLL 
exports so I can't use those. Following ID_VIEW_SOURCE resource ids led 
me to some code which eventually displays the source code, but it does 
that in a Mozilla window and I lost track of the point at which the page 
code is available and then sent to the window. I require just the page 
source as an ANSI or Unicode string or character pointer, not a window 
containing the source.


If it makes any difference to the question I'm working on a Windows box. 
Given its cross platform I doubt it will make a difference, but thought 
I should mention it anyway.


Does anyone know how to do this?

If I've posted this to the wrong newsgroup please tell me where I should 
have posted this question. Hoping someone can help.


I've already tried netscape.public.mozilla.browser and was pointed at 
this newsgroup.


Stephen
--
Stephen Kellett
Object Media Limitedhttp://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding