Note: Some or all of these workflows may not work on previous versions of 1Password including 1Password for iPhone, 1Password for iPad and 1Password Pro.
- URL Scheme
- Launch Center Pro Actions
- Bang On Custom Search URL
- Drafts Actions
- Mr. Reader Services
- Bookmarklets
- Additional Ideas
- Suggested Improvements for AgileBits
onepassword://
search/
Example:
onepassword://search/twitter
ophttp://
Example:
ophttp://www.google.com
ophttps://
Example:
ophttps://www.google.com
Documentation: Official - Developers: Here’s how to add a little 1Password to your iOS apps • handleOpenURL
ophttp://[[clipboard]]
This clipboard action isn't ideal because you need to make sure that you copied the link without the protocol http:// since 1Password doesn't know what to do with a URL that still has the protocol included. It gets confused by this kind of URL:
ophttp://http://www.google.com
ophttps://[[clipboard]]
The same is true for the https:// protocol, you can't include it.
onepassword://search/[clipboard]
ophttp://[prompt-URL]
Not being able to include the protocol actually works in our favor for the prompt actions, that's seven or eight fewer characters you have to type.
ophttps://[prompt-URL]
onepassword://search/[prompt]
onepassword://search/%@
Name: Open Link (without protocol) in 1Password
URL:
ophttp://[[title]]
Note: This action will send 1Password whatever is on the first line of your draft.
This URL action isn't ideal because you need to strip out the protocol manually since 1Password doesn't know what to do with a URL that still has the http:// protocol included. It gets confused by this kind of URL:
ophttp://http://www.google.com
To install the action copy and paste the following URL into your iOS browser's location bar and hit enter • Help
drafts://x-callback-url/import_action?type=URL&name=Open%20Link%20%28without%20protocol%29%20in%201Password&url=ophttp%3A%2F%2F%5B%5Btitle%5D%5D
App Name: 1Password
Protocol: onepassword:
HTTP URL Scheme:
ophttp://[URL-WITHOUT-PROTOCOL]
HTTPS URL Scheme:
ophttps://[URL-WITHOUT-PROTOCOL]
App Name: Search 1Password for Selection
Protocol: onepassword:
URL Scheme Template:
onepassword://search/{[TEXT-SELECTED]}
Visibility:
Standard Menu: Off
Text Selection Menu: On
Link Menu: Off
Important Note: Bookmarklets that take advantage of your text selection work differently or don't work at all in different browsers. Please see the guide for further details and workarounds.
javascript:window.location='op'+(window.location.href);
From the MacStories post about 1Password 4.1.
javascript:location.href='onepassword://search/'+encodeURIComponent(window.getSelection());
javascript:var%20search=window.prompt('Search%201Password%20for...');location.href='onepassword://search/'+encodeURIComponent(search);
javascript:var%20domainString=document.domain;if(domainString.substring(0,4)=='www.'){domainString=domainString.substring(4)}location.href='onepassword://search/'+domainString;
Expanded:
javascript:
var domainString = document.domain;
if (domainString.substring(0,4) == 'www.') {
domainString = domainString.substring(4)
}
location.href = 'onepassword://search/' + domainString;
This bookmarklet will work great if you always name your 1Password logins by the domain name (twitter.com), the default naming convention if you save logins via the desktop browser extensions.
However, if you name all of your logins by the site name (Twitter) this won't work very well because 1Password for iOS currently only searches the login titles, not the URLs or other information. This means that searching for twitter.com won't find an item with the title Twitter due the URL suffix. See Update below.
I personally prefer naming everything by the site name because it seems cleaner and it's easier to find items at glance. Because of the search limitation this bookmarklet isn't a great solution for me for the time being. I hope that AgileBits will improve the search functionality to include URLs, if they do this bookmarklet will become infinitely more useful.
Alternatively, if you don't already use the domain in the title you could always change your naming convention. Being a bit OCD and having over 1000 logins in 1Password I think I'll wait for now and use the following bookmarklet instead.
Update: There does seem to be some discrepancy with this, for instance, searching for twitter.com will bring up two of my five Twitter logins. Looking at the information stored in the logins I'm not sure what makes the difference, each of them are set to: http://twitter.com/
I will check with AgileBit's support to see if they know what's going on.
javascript:var%20search=window.prompt('Search%201Password%20for...');if(search==''){var%20search=document.domain;if(search.substring(0,4)=='www.'){search=search.substring(4);}}location.href='onepassword://search/'+encodeURIComponent(search);
Expanded
var search = window.prompt('Search%201Password%20for...');
if (search == '') {
var search = document.domain;
if (search.substring(0,4) == 'www.') {
search = search.substring(4);
}
}
location.href = 'onepassword://search/' + encodeURIComponent(search);
This bookmarklet combines the prior two, I thought it could be useful to have the domain feature built into a single bookmarklet for anyone that sometimes uses the domain naming convention.
javascript:(function(){var%20selection=window.getSelection()+%22%22,domain=document.domain.replace(/^ww.*%3F\./gi,%22%22),search=selection||window.prompt(%22Search%201Password%20for...%20\n\nEmpty:%20%22+domain+%22\n%22+'%22O%22:%20O̲pen%20url%20in%201P%20browser');null!==search%26%26(window.location=%22o%22===search.toLowerCase()%3F%22op%22+window.location.href:%22onepassword://search/%22+encodeURIComponent(search||domain))})();
Expanded
(function(){
var selection = window.getSelection() + "",
domain = document.domain.replace(/^ww.*?\./gi, ""),
search = ( selection || window.prompt(
'Search 1Password for... \n\n' +
'Empty: ' + domain + '\n' +
'"O": O\u0332pen url in 1P browser'
));
if (search !== null) { // stop if the user clicked cancel
window.location = (search.toLowerCase() === 'o') ?
'op' + (window.location.href) :
'onepassword://search/' + encodeURIComponent(search || domain);
}
}());
A bookmarklet that combines the Search 1Password for Selection bookmarklet with Search 1Password for...? If Empty Search for Domain..
Bonus: Enter O
(for "Open") as your search query to open the current URL in the 1Password Browser.
- A expanded bookmarklet that combines the Search 1Password for Selection bookmarklet with Search 1Password for...? If Empty Search for Domain.. Selection > Prompt > Domain.
-
Being able to search beyond item names to URLs and other item information would be a huge improvement to open up more URL Scheme workflow possibilities.
-
It would be fantastic if they switched over to (or added support for) x-callback-url functionality. One way I think they could use this is to designate coping a password to the clipboard as x-success.
If they were to do this you could setup a bookmarklet to open 1Password and search for the site (hopefully by URL), 1Password could automatically select the login if there's only one result or let you choose. You could then copy the password and 1Password would send you back to your chosen browser with the password ready for you to paste. It isn't quite like having a browser extension but it could be the most seamless 1Password workflow possible on iOS.
-
It would be nice to have ophttp://http:www.google.com, ophttps://https://www.google.com or even ophttp://https://www.google.com work so that 'Open URL in 1Password' actions could be added to apps like Drafts that don't offer JavaScript (like a browser) or more advanced URL configurability (like Mr. Reader) to automatically strip away the http:// protocol and replace it with ophttp://. Mercury Browser is a good example of this working.
For a security centric application I think this is important because it would also help ensure that an users who may currently need to strip out the protocol wouldn't accidentally open an https:// link as http://.