开发者

Which methods and class will be invoke when reload a webpage or open a new webpage in safari

开发者 https://www.devze.com 2022-12-10 02:51 出处:网络
As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit inform开发者_C百科al protocol(WebFrameLoadDelegate):

As we know , When we load frame from webpage of safari, we will invoke the delegate methods of webkit inform开发者_C百科al protocol(WebFrameLoadDelegate):

webView:didStartProvisionalLoadForFrame:

webView:didChangeLocationWithinPageForFrame:

But I want to know whick class and methods will be invoked when reload a webpage or open a new webpage in safari ? Thank you very much!


The same delegates are called, you just need to check that the webFrame that is sending this delegate message is the mainFrame by checking that it has no parent. For example:

- (void)webView:(WebView *)sender didStartProvisionalLoadForFrame:(WebFrame *)frame {
    if(![frame parentFrame]) {
        // There is no parent frame so this is the main frame.
    }
    // other actions for child frames.
}
0

精彩评论

暂无评论...
验证码 换一张
取 消