erasing iPhone browser history

Is there a swift command/function that allows me to erase the iphone browser history or elements within that history?

Replies

Is there a swift command/function that allows me to erase the iphone browser history or elements within that history?

I presume you’re specifically refer to the browser history maintained by Safari, in which case the answer is “No.”

Can you elaborate more on what you app does? Depending on your situation, you may be able to accomplish your goal using

WKWebView
. Or it’s possible that your only option would be to file an enhancement request for a new API.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi, that seems to be a duplicate from what you posted in getting started. Should remove the other one.

I am looking at an app right now that does this. A user goes to a website (site 1) and the app changes the page (to site 2) the person is viewing on that website. Then, it changes the history of the web address so it only appears the person went to site 2 if he goes to the viewing history.

JavaScript running in a web view has access to the web view’s history via the

window.history
property. There are, however, significant limitations here:
  • You won’t see Safari history in a

    WKWebView
    (or the legacy
    UIWebView
    ).
  • I’m not sure where you’ll see Safari history in an

    SFSafariViewController
    [1] but, even if you do, you can’t explicitly run JavaScript in that view.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

[1] It used to be the case that

SFSafariViewController
was Just Like Safari™, but we’ve added more restrictions recently.