DEV Community

vast cow
vast cow

Posted on

Switching from the ChatGPT Web Page to the ChatGPT App on iOS

On iOS, it is possible to move directly from the ChatGPT website in a browser to the ChatGPT app by using a custom URL scheme. The basic idea is to take the current web page address and rewrite it into a format the ChatGPT app can understand, then instruct the device to open that link.

The following JavaScript snippet performs that redirection automatically:

javascript:!function(){location.href="chatgpt://"+location.host+location.pathname+location.search+location.hash}();
Enter fullscreen mode Exit fullscreen mode

When executed on a ChatGPT web page, the script builds a new URL that starts with chatgpt:// instead of https://. It then appends the current page’s host, path, query parameters, and hash fragment. This preserves the specific page location and any parameters in the URL, so the app can attempt to open the corresponding destination.

In practice, this approach is commonly used as a quick “handoff” method—especially when you are viewing ChatGPT in Safari (or another iOS browser) and want to continue in the native app experience without manually copying and pasting links.

Top comments (0)