Carlos Molina wrote:
Niky Williams wrote:
Niky Williams wrote:
Boris Zbarsky wrote:
Niky Williams wrote:
I can on MFCEmbed
Here is what I did to reproduce it:
did a "make" on MFCEmbed and moved the .exe into /dist/bin
After running MFCEmbed, paste in the following url
http://www.elcars.com/popup.html
The FIRST time it seems to come up okay...but if you click on the
URL edit box and hit enter (or click refresh), the alert box is blank.
Hmm... With TestGTKEmbed this works for me every time. :(
Is there useful console output in a debug build here?
-Boris
I'm using a non-debug build...poo...I'll see if I can find some time
today to recompile with debug, unless someone can get to it before I
can.
Niky Williams
I've noticed that when I override the prompt service (FF 1.5.0.2
codebase) and just implement them myself, everything is passed as it
should be to the various functions...well..so far. I've only tested
the Alert, AlertCheck and ConfirmEx.
Does anyone know a smoketest to test all the prompts that we can
override? Nine I think I counted.
Niky Williams
It is just what I am planning to do, at the moment I changed the alert
function in prompt service.. ( so the first pop up blank it doesn't
appear anymore)
But I think that is more elegant to override the prompt.
How have you done this override?
Can this override be considered and implemented as external component?
In this way you can migrate your popups in other mozilla versions.
Carlos Molina
Well, from what I could understand reading the docs, there are 2 ways to
do this. Here is a quote from
http://www.mozilla.org/projects/embedding/windowAPIs.html on that subject
"The PowerPlant example is more is more straightforward. Its
PromptService is implemented directly in the application executable, not
as a separate library. This is perfectly workable, as the example
illustrates. The MFC example implements its PromptService in a separate
DLL, and overrides the default PromptService only if it is able to load
the override DLL at application startup. Its PromptService dialogs can
be switched between default and overridden by moving the override DLL
into or out of the library search path."
I prefer the straightforward approach as it works for me.
Here is basically what I did to register my prompt service class...
nsCOMPtr<nsIComponentRegistrar> pCOM_cr;
nsCOMPtr<nsIGenericFactory> pCOM_gf;
//Info for overriding prompts
static const nsModuleComponentInfo mci = {"Prompt Service",
NS_PROMPTSERVICE_CID, "@mozilla.org/embedcomp/prompt-service;1",
CGeckoPromptConstructor};
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//Getting the component registrar
NS_GetComponentRegistrar (getter_AddRefs (pCOM_cr));
//Creating a factory
NS_NewGenericFactory (getter_AddRefs (pCOM_gf), &mci);
//Registering the factory now
pCOM_cr->RegisterFactory (mci.mCID, mci.mDescription, mci.mContractID,
pCOM_gf);
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I do this when I initialize my Gecko browser class, only needed once.
Hope this helps!
Niky Williams
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding