Things got a little backed up - we're processing the data and things should be back to normal within the hour.

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
How to turn a "pageless" bookmarklet into a shortcut?
Post Body

I have several bookmarklets saved as favorites in Safari on iOS. They are "pageless" in the sense that they don't do anything to the page I'm on, and I don't need to be on a page to run them. I launch them as bookmarks from a Safari new tab page, and they present a pop-up dialog box. I type a query, and they string that query to a URL and open it.

Here's an example bookmarklet that let's me search terms on Naver, the Korean version of Google:

javascript:var s=prompt('Naver search');if(s==null){}else if(s==''){alert('Please enter search terms')}else{location.href='https://m.search.naver.com/search.naver?query=' encodeURIComponent(s);}

I'm trying to reproduce this in a shortcut that I could then launch from a lockscreen widget or a homescreen icon.

I was hopeful I could just add the bookmarklet to the homescreen the same way you add any other bookmark, but no luck. Meanwhile, I am struggling to modify other people's shortcuts to get the behavior I want, but again, no luck. This feels like it ought to be simple but maybe I'm just too dumb.

What I want:

  1. Press a home screen icon
  2. Pop-up dialog box appears, asking me to enter a word or phrase.
  3. That word/phrase gets added to a URL in the right location
  4. That URL is opened in Safari

Author
Account Strength
100%
Account Age
10 years
Verified Email
Yes
Verified Flair
No
Total Karma
36,050
Link Karma
24,288
Comment Karma
11,076
Profile updated: 3 days ago
Posts updated: 5 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago