Forum Archive

1Password / Javascript Bookmarklet / URL Scheme / Workflow Help...

calebaharrison208

Hey Folks,

I'm having a hard time figuring out my workflow, here. My goal is this:

  • Visit any webpage (specifically those with 'www.' subdomain)
  • Hit javascript bookmarklet
  • Bookmarklet sends domain name to Editorial, which strips 'www.' from domain
    • Some of my 1p website fields do not have the 'www.' in them, and won't be found (i.e. 'www.google.com' does not pull up 'google.com')
  • Editorial sends stripped text to 1p as search.

Here's what I have so far.

Bookmarklet

javascript:window.location='editorial://?command=1pSearch&input='+window.location.hostname

The command runs, but it just runs the command on an empty input, it seems. That is, 1p launches with a blank search.

1pSearch Workflow

Here's the link to my workflow.

Any help is appreciated!

omz

I think it would probably be easier to strip the www. within the JavaScript of the bookmarklet, you don't really need Editorial for that.

calebaharrison208

Ah, took me some time to figure out how to script that with JS, but you're right, it works better that way. If anybody is interested, here's my bookmarklet:

javascript:text=window.location.hostname;if(/www\./.test(text)){text=text.replace(/www\./,"");window.location='onepassword://search/'+text;}else{window.location='onepassword://search/'+text;}

Thanks for the quick response, Ole!