Hi, thanks for you answer,
I've read the source  inspector.js, and i implemented it like in your
example
But.. when i click links, it's not working and the page redirects

this is the code:

function startInspector()
{
        try
        {
                window.content.document.addEventListener("mouseover",
                                inspectElement, true);

                window.content.document.addEventListener("mousedown",
                                stopInspecting, true);
        } catch (e)
        {
                alert(e);
        }

}

function stopInspecting(event)
{
        //alert("a");
        window.content.document.removeEventListener("mouseover",
                        inspectElement, true);

        window.content.document.removeEventListener("mousedown",
                        stopInspecting, true);
        cancelEvent(event);

}

function cancelEvent(event)
{
        event.stopPropagation();
        event.preventDefault();
}

can you figure out why it's not working for me?

thanks Dan


On May 28, 10:18 am, Jan Honza Odvarko <[email protected]> wrote:
> Look for inspector.js file in the Firebug source base.
>
> 1) You are especially interested in startInspecting and stopInspecting
> methodshttp://code.google.com/p/fbug/source/browse/branches/firebug1.8/conte...
>
> 2) startInspecting calls attachInspectListeners method that register
> bunch of listeners for key and mouse events
>
> 3) One of them is "mousedown" and "mouseover"
> subWin.document.addEventListener("mousedown",
> this.onInspectingMouseDown, true);
> subWin.document.addEventListener("mouseover",
> this.onInspectingMouseOver, true);
>
> 4) onInspectingMouseDown calls Events.cancelEvent(event); at the end
>
> 5) cancelEvent is implemented as follows:
>
> Events.cancelEvent = function(event)
> {
>     event.stopPropagation();
>     event.preventDefault();
>
> };
>
> So, every click is consumed by Firebug first and prevent links and
> buttons to be active.
>
> Honza
>
> On May 28, 12:25 am, Dan Adika <[email protected]> wrote:
>
>
>
>
>
>
>
> > Hi all,
> > when inspecting elements with firebug, all the elements are not
> > clickable and the element is highlighted.
>
> > how firebug prevent from links and buttons to be active, how it's
> > implemented?
>
> > Thanks
> > Dan

-- 
You received this message because you are subscribed to the Google Groups 
"Firebug" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/firebug?hl=en.

Reply via email to