Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7606423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T00:24:22+00:00 2026-05-31T00:24:22+00:00

I have a WebKit-based application. When the user initiates an action that opens a

  • 0

I have a WebKit-based application. When the user initiates an action that opens a new page (such as clicking on a link), I would like to intercept that URL and choose to to open it in my application, or kick it out to Safari.

Ideally, I’d like to identify the first request in a loading sequence, or the one that directly resulted from a user action. Alternatively, it might be enough if I could identify changes to the top-level URL in a frame, with the caveat that I need to be able to cancel the request if I decide to bounce it to Safari instead.

I have implemented webView:decidePolicyForNavigationAction:request:frame:decisionListener, and I can see all of the requests made during the loading of the page. Both the requests triggered by the user, as well as those kicked off by Javascript, REST calls, that kind of thing.

For simple links, I can get the WebActionNavigationType from the action information. But if the user clicks on an element with a Javascript onclick() handler, which in turn navigates to a different page, the navigation type will be “Other”, and indistinguishable from all other Javascript requests (i.e. secondary REST calls resulting from the original request).

Any one else tackled this? Any pointers? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T00:24:23+00:00Added an answer on May 31, 2026 at 12:24 am

    I figured out something that seems to work for me. In decidePolicyForNavigationAction, this test will determine if it was a user-initiated action:

    BOOL isUserAction = (
        [frame isEqual:[sender mainFrame]] &&
        [[request URL] isEqualTo:[actionInformation objectForKey:WebActionOriginalURLKey]]
    ); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a doc-based ARC-enabled application I have a WebView that is opening an HTML
Here's the situation: I have a web-based ticket application, multiple users. One problem that
I have a Rails app that I have successfully tested with Mongrel and Webkit.
I have a short css-based animation that I want to play out before a
I have an Android application that generates some HTML which is rendered locally, in
I have a layout which renders perfectly fine in Webkit based browsers but in
I'm developing a js application on a CE-HTML browser based television. So I have
In a C#/ASP.NET application, I have a form that renders much like the following
I have created a simple application using MVC3 and the site is based on
We have some JavaScript code that resizes <div/> elements (adjusts height/width/padding/margin etc.) based on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.