I’m trying to create a simple iOS “Share” action using the Shortcuts app that will allow me to bookmark a page (preferably including both the page title and URL) into a specified draft by appending it.
While there’s a default share action bundled with iOS Drafts, it only posts the URL and creates a new draft (which I don’t want).
I was able to get the action working in Safari, but since I exclusively use Chrome, I’ve encountered some issues. First, I had to disable “Safari web page” and only allow “Rich Text” and “Article” as Share Sheet inputs. Now, I can finally get both the title and URL to show up in my draft.
However, there’s still one problem: every time I run the action, I’m prompted to allow the Shortcut to read the web content from a specific domain, even though I’ve already given Chrome permission to “Always” allow Shortcut access.
So, I have to manually grant permission for each new domain.
Any tips or solutions for streamlining this seemingly simple Share action?
My observation is that when I allow “Safari Web Page” as a Share Sheet input and extract the page URL from it, everything works perfectly in Safari without triggering any privacy permission requests. However, when the same action is called from Chrome, it results in the error: “Text failed because Shortcuts couldn’t convert from URL to Safari web page.”
When you deal with Safari, Safari is passing you the title and URL.
When you are dealing with Chrome, I strongly suspect it is just sharing the URL. For Shortcuts to store the title, it needs to visit the URL and retrieve the title. To do this it needs to reach out across the Internet to a particular domain and then Shortcuts as an automation needs your permission to do so.
Are you wanting to run this cross platform, or just on one platform?
E.g. if you were running this on macOS, you might well be able to use a bit of AppleScript to get the title of the front tab in Chrome and pass that into Shortcuts.
I just need it for iOS. Basically I am gathering the list of interesting URLs with which I can later work / comment / organize on iMac. It would save a lot of time if I could add bookmarks including title, but Chrome feels much better on iOS although they share the same web engine with Safari. And it also provides better user experience, because you share your user profile with Chrome on Mac.
Still it seems appropriate if there was a privilege to set to “Always” to allow this kind of automation.
I think you might struggle. You are butting up against the IOS security model and against a limited set of Shortcuts actions for Chrome - they are all about opening parts of the browser and not about data exchange.
While you could maybe use a call out to say Scriptable or Pythonista to get a page title for you based on the URL, getting it from the fully rendered page in a browser is always going to be more reliable as more complex pages can render in different ways. But I am sure you could create a script that will work most of the time that you could then incorporate into a shortcut. I think the script would need to be external to Shortcuts to not hit the security message, but that’s something you could experiment with to see if it would work. I’ve not had news to dig into this so it is certainly some assumptions on my part - but Chrome simply isn’t a first class automation citizen on iOS.