ClintonStrong

Search Safari and Chrome Tabs [Updated Feb 8, 2014]

99 posts in this topic

Search your tabs in Safari, Chrome, Chromium, Chrome Canary, and Webkit.

Screen%20Shot%202013-01-19%20at%2012.42.

When you action a result, it'll bring your browser to the front and switch to the selected tab. You can also close a tab by holding down alt when actioning a result.

Download from Packal

 

Updated Feb 8, 2014: Made it more resilient to an AppleScript error that could cause a blank output.

 

Update #2, Feb 1, 2014: Fixed regression with searching. You should be able to search anchored by words (and capital letters in CamelCase words) again.

 

Updated Feb 1, 2014: Rewrote the workflow. It now supports copying the URL of a tab, viewing a tab in QuickLook, and closing a tab with a modifier key.

 

Updated Oct 11, 2013: Fixed issue with improper string encoding in Mavericks and Ruby 2.0 breaking the workflow.

 

Updated Oct 9, 2013: Updated for Mavericks and Ruby 2.0.0. Removed thumbnails for now (beta versions of Safari don't seem to generate them anymore). Fixed some issues where the proper window wouldn't always focus correctly.

 

Updated May 4, 2013: Experimental support for webpage thumbnails. Prevent launching browsers when WebKit is open.

Updated Mar 26, 2013: (Hopefully) prevent launching browsers when it's not supposed to, and fix an issue with it not detecting WebKit.

Edited by Clinton Strong
cands, thec13, drking and 13 others like this

Share this post


Link to post

Well done, this is great, works like a charm too. At first I was having problems getting it to pick-up tabs, but after I removed coreutils from my path it started working no problem. Thanks for sharing and uploading this as well as "View Recent Folders" to AlfTP. Great workflows.

Share this post


Link to post

Very nice.

In case you guys use Chrome Canary (or Chromium) like I do, just search and replace "Google Chrome" with "Google Chrome Canary" in the workflow ruby files and you're good to go.

Share this post


Link to post
Can you add support for Chrome Canary?

I plan to add support for Canary, Chromium, and Webkit (I've already coded most of it). Unfortunately I'm having some issues with my system right now, but I'll try to get it updated as soon as I can.

 

Edit: Done.

OliverJAsh likes this

Share this post


Link to post

Updated. You can download it here or in my original post.

  • Fixed an issue with tabs not showing up for Safari.
  • Improved performance. You may still get some slowdown if you're running multiple browsers at the same time, but that'll be fixed in the next update.

I'm working on a rewrite to further improve performance and add a few new features. It's not quite ready yet, but I'll try to get it out soon.

drking and mccamel like this

Share this post


Link to post

Love this workflow.  One thing that I'd really like to see is the ability to copy the URL of a tab-- I hope something like this makes it into your new version!

Share this post


Link to post

Is there a way to change the Hotkey trigger to a keyword tigger (inputs >keyword)?

 

It should be wired up to support both a keyword and a hotkey. The default keyword is "tabs".

Share this post


Link to post

Is there a way for this to not open Chrome when running the workflow? I mainly use Safari and only occasionally use Chrome, so have it closed most of the time. Or if that's not possible just a workflow to search Safari tabs, without Chrome :)

Share this post


Link to post

Is there a way for this to not open Chrome when running the workflow? I mainly use Safari and only occasionally use Chrome, so have it closed most of the time. Or if that's not possible just a workflow to search Safari tabs, without Chrome :)

 

Hm, it shouldn't be opening a browser if it isn't already running. It just looks for "Google Chrome.app" in the process list (`ps ax`), but maybe there's a background process running that it's picking up.

 

I tried making the search a bit more specific to make sure the browser itself is running, and not just a helper app. Let me know if that fixes it. (Updated download link in the original post.)

Jono likes this

Share this post


Link to post

Hm, it shouldn't be opening a browser if it isn't already running. It just looks for "Google Chrome.app" in the process list (`ps ax`), but maybe there's a background process running that it's picking up.

 

I tried making the search a bit more specific to make sure the browser itself is running, and not just a helper app. Let me know if that fixes it. (Updated download link in the original post.)

 

I think I stumbled upon a bug in your search script. If WebKit is open, every supported browser is opened when firing the script. I don't know Ruby too well, but it appears that the '||' [or] operand on line 69 is the culprit.

 

Works everywhere else! Thanks  :)

Share this post


Link to post

I think I stumbled upon a bug in your search script. If WebKit is open, every supported browser is opened when firing the script. I don't know Ruby too well, but it appears that the '||' [or] operand on line 69 is the culprit.

 

Works everywhere else! Thanks  :)

 

Thanks for pointing that out. Just published a new version (link in the original post), so let me know if you have any problems.

 

Oh, and I threw in webpage thumbnails for Safari users. It doesn't seem to work with pages served over SSL (HTTPS), but I tried to add in some placeholder images to help with that. It's still an experimental feature, so let me know if you have any feedback.

Edited by Clinton Strong

Share this post


Link to post

Thanks for pointing that out. Just published a new version (link in the original post), so let me know if you have any problems.

 

Oh, and I threw in webpage thumbnails for Safari users. It doesn't seem to work with pages served over SSL (HTTPS), but I tried to add in some placeholder images to help with that. It's still an experimental feature, so let me know if you have any feedback.

 

WebKit bug seems to be fixed (many thanks  :) ). I am not a huge fan of the previews; the icons look cleaner. Maybe it should be optional? At least until Alfred's feedback output system matures.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now