Giter Site home page Giter Site logo

epilande / alfred-browser-tabs Goto Github PK

View Code? Open in Web Editor NEW
394.0 9.0 33.0 18.23 MB

🔍 Search browser tabs from Chrome, Brave, Safari, etc..

License: MIT License

JavaScript 100.00%
alfred chrome brave safari browser tabs workflow switch vivaldi alfred-workflow

alfred-browser-tabs's Introduction

Alfred Browser Tabs 🔍

Search browser tabs from Chrome, Brave, Safari, etc..

Why?

You have hundreds of tabs open that you need to sift through and ain't nobody got time for that.

Features

  • 🏎 Blazing fast!
  • 💪 Supports Chrome, Brave, Edge, Vivaldi, Safari.
  • 🔍 Fuzzy search title & URLs.
  • ✨ Relevant results (last active window).
  • 🌶️ Customizable hotkeys & keywords.
  • 📋 Copy URL to clipboard.

Installation

  1. Download the Alfred Workflow (Browser-Tabs.alfredworkflow).
  2. Double-click to import into Alfred (requires Powerpack).
  3. Review workflow, add hotkeys, customize.

Demo

Usage

I would recommend setting up a hotkey to toggle the workflow to immediately search open tabs. For example:

setup hotkey

Commands

  • chrome tabs {query} - Fetch tabs from Google Chrome and filter based on query.
  • brave tabs {query} - Fetch tabs from Brave Browser and filter based on query.
  • edge tabs {query} - Fetch tabs from Microsoft Edge and filter based on query.
  • vivaldi tabs {query} - Fetch tabs from Vivaldi and filter based on query.
  • safari tabs {query} - Fetch tabs from Safari and filter based on query.

Copy to clipboard

Holding the CTRL key while selecting an item will copy the selected tab URL to your clipboard.

More workflows

License

MIT License

alfred-browser-tabs's People

Contributors

chaitanyadeorukhkar avatar daniel-stoneuk avatar epilande avatar kgrhartlage avatar lucaswilric avatar mvgrimes avatar tru2dagame avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alfred-browser-tabs's Issues

Multiple windows

This doesn't seem to be able to switch to the tab correctly when you have multiple chrome windows open

Support for Opera?

I tried to modify the workflow to add Opera functionality, but its not working. Any ideas on how to get it to work?

get both title & url

can we have another 2 modifiers below to get title of the tab?

  • Cmd+Return: it will title of the tab
  • Option+Return: it will title + URL of the tab with format "title <title>, URL: <url>"

Does not switch desktops

Hi,

Thank you for the wonderful workflow it's truly a timesaver!
The issue I'm facing is that if the Safari tab I'm focusing on is on another desktop/Space then it doesn't switch to that one.
Instead it focuses on the last Safari window that I have used on the current desktop/Space.

Is that intended functionality? Thanks

undefined is not an object (evaluating 'chrome.windows.tabs.title')

When I try the 'chrome tabs' shortcut the log displays this error:

[08:18:07.778] Logging Started...
[08:18:14.175] Browser Tabs[Hotkey] Processing complete
[08:18:14.178] Browser Tabs[Hotkey] Passing output '' to Script Filter
[08:18:14.203] Browser Tabs[Script Filter] Queuing argument '(null)'
[08:18:14.326] Browser Tabs[Script Filter] Script with argv '(null)' finished
[08:18:14.328] ERROR: Browser Tabs[Script Filter] Code 1: ./list-tabs.js: execution error: Error: TypeError: undefined is not an object (evaluating 'chrome.windows.tabs.title') (-2700)

Screenshot 2021-05-23 at 08 24 46

Screenshot 2021-05-23 at 08 22 46

I have plenty of tabs open. It also happens when I restart Chrome and do the command with only the 'New tab' open.
Chrome: Version 91.0.4472.69 (Official Build) beta (x86_64)
Alfred: 4.3.4 (1229)

Feature request: search all open browsers

Instead of having to filter by browser or have separate hotkeys, I was wondering if there was an efficient way of combining multiple browsers (say Chrome, Brave, and Safari) into a single hotkey? This would be most helpful for my workflow and perhaps others. But the way this is designed it seems to be isolated by browser.

Include tabs in default search results

I wonder whether it is currently possible with this workflow to include tabs in the default alfred search results (just like bookmarks can be included there)?

Safari – Window Hide/Show on Tab Selection

Unsure if this is intended behaviour but right now when I select a tab my current window, even if active, goes through what looks like a hide/show cycle to bring up the new tab. Is this simply a limitation of what is possible or is it a bug?

hideshow

Error with brave

Hi, great workflow, very helpful
But when I try to query brave I get the following error in debug mode:

[11:47:21.074] ERROR: Browser Tabs[Script Filter] Code 1: ./list-tabs.js: execution error: Error: Error: An error occurred. (-1743)

Favicon support?

Would be awesome if you could somehow show the favicon for each tab 🔥

Firefox support

Hi, thank you for the workflow!
Any plans for supporting Firefox?

Feature Request - Send to Google Search if no result is found

I didn't know where else to post a feature request. I hope this is okay.

Your plugin is now the first thing I use when I want to interact with the browser. I've made "tab searching" the first thing I do when thinking of anything browser-based. What frequently happens however is when I'm typing and nothing turns up, it's because that tab isn't already open.

I'm hoping you could add a feature where if there are no results, pressing enter just sends whatever I've already typed to Google Search.

Thank you for your plugin!

`Permission denied` on macOS Sonoma

When running browser tabs on Sonoma, the workflow throws the following error when finding Safari tabs

ERROR: Browser Tabs[Script Filter] Code 126: /Users/bruth/Library/Caches/com.runningwithcrayons.Alfred/Workflow Scripts/7FBFA554-C1F4-42FE-8419-D33AA3BAEAF2: line 1: ./list-tabs-webkit.js: Permission denied

This causes the workflow to not work for Safari.

Edge - Workspaces (or windows) search

The Edge browser has a Workspaces feature. It would be nice to have the ability to search for a workspace and navigate to it. If it's hard to search for just a workspace, I guess a window search would be fine.

example)

list-workspaces.js

#!/usr/bin/env osascript -l JavaScript

function run(args) {
  let browser = args[0];
  if (!Application(browser).running()) {
    return JSON.stringify({
      items: [{
        title: `${browser} is not running`, subtitle: `Press enter to launch ${browser}`,
      },],
    });
  }

  let chrome = Application(browser);
  chrome.includeStandardAdditions = true;

  let items = [];

  for (let window in chrome.windows) {
    let windowId = chrome.windows[window].id();

    items.push({
      title: chrome.windows[window].title(),
      arg: `${windowId}`,
    });
  }

  return JSON.stringify({items});
}

focus-workspace.js

#!/usr/bin/env osascript -l JavaScript

function run(args) {
  ObjC.import("stdlib");
  let browser = $.getenv("browser");
  let query = args[0];
  let [arg1] = query.split(",");
  let windowId = parseInt(arg1);

  focusWindow(browser, windowId);
}

function focusWindow(browserName, windowId) {
  let chrome = Application(browserName);
  chrome.includeStandardAdditions = true;

  let window = chrome.windows.byId(windowId);
  window.visible = true;
  window.index = 1;
  chrome.activate();
}

Edge support

Please add support for Microsoft Edge (shockingly a great browser) which is built on top of Chromium

chrome tabs not working on Ventura Mac with Alfred 5

I suspect the location setting, Japan?

When typing "chrome tabs", it turns to Search Google for 'chrome tabs'...

Any idea to solve it?

I removed Google from default web search and workflow related to searches.

image

Safari tab

Hello, after choosing the tab you want and press enter, if you have multiple windows opened, it selects the correct tab but it does not show the window in the front of the others. It keeps the safari window with the correct tab in the background.

Sort tabs by most recently used?

Awesome workflow!!

Any chance you could explore sorting the default results e.g. "chrome tabs" to sort the tabs by most recently used?

How use Google Chrome Canary?

Hello everyone! When I tried to change chrome object with "Google Chrome Canary" in Alfred I received list tabs but when I push button nothing is happening. Debugger report: "ERROR: Browser Tabs[Run Script] ./focus-tab.js: execution error: Error: Error: Application can't be found. (-2700)"

[Bug] replaceAll is not defined - Node version compatibility?

ERROR: Browser Tabs[Script Filter] Code 1: ./list-tabs.js:990:1054: execution error: Error on line 39: TypeError: matchUrl.replaceAll is not a function. (In 'matchUrl.replaceAll(/[^\w]/g, " ")', 'matchUrl.replaceAll' is undefined) (-2700)

I believe this is a node compatibility issue, as replaceAll was introduced in Node v15 but that was not noted

[SOLVED] ./list-tabs.js execution error

The latest Alfred update may have broken something.

on Alfred 5.1[2134], when I use the keywords for Edge or Chrome tabs, I get this error:

[13:36:50.981] Logging Started...
[13:36:52.914] Browser Tabs[Script Filter] Queuing argument '(null)'
[13:36:53.073] Browser Tabs[Script Filter] Script with argv '(null)' finished
[13:36:53.077] ERROR: Browser Tabs[Script Filter] Code 1: ./list-tabs.js: execution error: Error: Error: An error occurred. (-1743)

Seems to be a duplicate of this issue, which was fixed back in 2021.

Any ideas anyone?

Feature: Unified search across all browsers

Love the workflow, thank you for creating it.

I would love to search across all browsers, perhaps via a tabs {query} command, as sometimes I do not know in which browser I have the relevant tab open.

Manage tabs with other key functions

Hello,
I recently added a new script to use with the command key to open the current tab in a new window and close the original tab.
I reused the script described in this page.

Screenshot 2023-05-23 at 15 50 18

I would like to know if it would be possible to add some actions with the other function keys, like:

  • Close tab,
  • Close all tabs,
  • Open all bookmarks of a folder,
  • etc

Feature Request: Add 'quicklookurl' property

I sometimes want to look at a tab I know I have open without actually switching applications.

tabsMap[url] = {
  quicklookurl: url,
};

If you care for it, I can open a PR.

Thank you for considering and making this workflow.

Simply not working… javascript execution error (matchUrl.replaceAll is not a function…)

I just installed the workflow and when I tried it, nothing…
(no results, just the default Alfred web search options after loading of the workflow…)

Even after a relaunch of Alfred and Chrome.

Here is what I see in the Alfred debugger:

[19:19:09.107] Browser Tabs[Script Filter] Queuing argument '(null)'
[19:19:09.475] Browser Tabs[Script Filter] Script with argv '(null)' finished
[19:19:09.478] ERROR: Browser Tabs[Script Filter] Code 1: ./list-tabs.js:990:1054: execution error: Error on line 39: TypeError: matchUrl.replaceAll is not a function. (In 'matchUrl.replaceAll(/[^\w]/g, " ")', 'matchUrl.replaceAll' is undefined) (-2700)

Alfred 4.6 [1266]
macOS 10.14.6
Chrome 95.0.4638.54

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.