Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
702 views
in Technique[技术] by (71.8m points)

dom - Safari extension beforeload event documentation

I can't find any documentation on the beforeload event other than the Blocking Unwanted Content section of this.

What I'm specifically looking for is the event message structure. From the above doc I know that there is a event.url member, but not much else. From a snip of source code I know there's also a event.target.nodeName member. But I don't have anything more than that.

I got lost in both the WebKit docs and w3 event docs. Where can I find some simple reference documentation for the beforeload event?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The DOM beforeload event is a WebKit concept, it is not specific to Safari extensions. It does have a URL property.

For some more information about the beforeload event - you can see:

http://opensource.apple.com/source/WebCore/WebCore-1298/dom/BeforeLoadEvent.idl

If you are using this in an extension content script, one way to get some more information about be to have some code like:

document.addEventListener("beforeload", beforeLoadHandler, false);

function beforeLoadHandler(event)
{
    console.log(event);
}

And then use the Web Inspector to view information about the event (you can see its URL, you can look at the event target, etc).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...