Type slash commands in Google Search and expand them into advanced search operators instantly.
/site github.com becomes site:github.com
/pdf becomes filetype:pdf
/title algorithm becomes intitle:algorithm
SearchSlash is a small Chrome extension built with plain JavaScript and Manifest V3. It works directly inside Google's search box and keeps the workflow keyboard-first.
Google search operators are powerful, but most people do not remember the syntax when they need it.
SearchSlash reduces that friction. Instead of typing:
site:github.com filetype:pdf intitle:algorithm
you can type:
/site github.com /pdf /title algorithm
and the extension rewrites the query inline.
- real-time slash operator expansion
- stack multiple operators in one query
- lightweight popup with examples
- no presets, no storage, no heavy UI
- works directly in Google's existing search field
| Shortcut | Expands To | Example |
|---|---|---|
/site |
site: |
/site github.com -> site:github.com |
/title |
intitle: |
/title algorithm -> intitle:algorithm |
/url |
inurl: |
/url python -> inurl:python |
/after |
after: |
/after 2024-01-01 -> after:2024-01-01 |
/before |
before: |
/before 2024-12-31 -> before:2024-12-31 |
/exclude |
- |
/exclude tutorial -> -tutorial |
/exact |
" |
/exact machine learning -> "machine learning" |
/related |
related: |
/related example.com -> related:example.com |
/link |
link: |
/link example.com -> link:example.com |
/define |
define: |
/define recursion -> define:recursion |
/cache |
cache: |
/cache example.com -> cache:example.com |
/author |
author: |
/author john -> author:john |
/source |
source: |
/source bbc -> source:bbc |
| Shortcut | Expands To |
|---|---|
/pdf |
filetype:pdf |
/doc |
filetype:doc |
/xlsx |
filetype:xlsx |
Single operator:
/site github.com
Result:
site:github.com
Multiple operators:
/site github.com /pdf /title algorithm
Result:
site:github.com filetype:pdf intitle:algorithm
Exact phrase:
/exact machine learning
Result:
"machine learning"
The extension injects a content script into supported Google domains. That script:
- detects the main search field
- listens for typing
- finds supported slash shortcuts
- rewrites them into Google operator syntax
- preserves the cursor position while updating the field
There is no backend, no build system, and no storage dependency for the main feature.
SearchSlash/
├── manifest.json
├── README.md
├── agents.md
├── src/
│ └── content-script.js
├── ui/
│ └── settings.html
└── icons/
├── icon-16.png
├── icon-48.png
├── icon-128.png
└── searchslash-variant3-source.png
Defines the extension metadata, content script injection, popup file, and icons.
This is the core logic. It handles:
- operator maps
- regex-based replacements
/exactquote handling- cursor preservation after rewriting the input
A simple popup that explains what the extension does and shows supported examples.
- Open
chrome://extensions/ - Turn on Developer mode
- Click Load unpacked
- Select this project folder
- Open Google and start typing slash commands in the search box
Test these flows after loading the extension:
/site github.com/pdf/title algorithm/site github.com /pdf /title algorithmpython /exclude tutorial/exact machine learning- press
Enterand verify the final query is correct
- only runs on supported Google domains in
manifest.json - does not validate whether a domain, date, or URL is valid
- assumes the user already understands what each Google operator means
- currently focused on Google Search, not other search engines
If you are new to Chrome extensions, understand these things first.
Every Chrome extension starts with manifest.json.
It tells Chrome:
- the extension name
- version
- permissions
- which scripts run
- which pages the extension can access
- what popup or icons to use
If your manifest is wrong, the extension usually does not load.
A content script is JavaScript that runs on matched websites.
In this project, the content script runs on Google pages and changes the search input directly through the DOM.
Use a content script when you need to:
- read page content
- listen to page events
- modify the page UI
Chrome extensions now use Manifest V3. The main difference beginners notice is that background pages are replaced by service workers.
For a small extension like this, you may not need a background service worker at all.
Extensions do not run everywhere by default.
You must explicitly define where the script runs, for example:
"matches": ["https://*.google.com/*"]If your pattern is too narrow, the extension seems broken.
If it is too broad, you create unnecessary risk and complexity.
Most beginner extensions are not complicated because of Chrome APIs. They are complicated because of page behavior.
You need to think about:
- how the target site structures its DOM
- whether inputs are replaced dynamically
- where events actually fire
- how to preserve cursor position
- what happens when the page rerenders
Do not ask for permissions you do not need.
Small extensions are easier to reason about, easier to debug, and easier for users to trust.
A lot of beginner extensions fail because they try to become a full product too early.
A better approach:
- make one thing work
- test it on the real site
- handle edge cases
- only then add more features
SearchSlash followed that path after removing unnecessary preset and dropdown logic.
For Chrome extensions, you usually debug in three places:
- the extension errors shown on
chrome://extensions/ - the browser DevTools console on the target page
- the popup DevTools if your popup has logic
If the extension loads but does nothing, check:
- whether the content script was injected
- whether the
matchespattern is correct - whether your target DOM selector still exists
Before building any extension, spend time with:
- Chrome Extensions overview
- Manifest V3 basics
- content scripts
- match patterns
- permissions
- messaging
- storage
- service workers
Read the official Chrome extension docs first. Then use MDN when you need JavaScript and DOM details.
SearchSlash intentionally stays narrow:
- one problem
- one input surface
- minimal UI
- no setup after install
That keeps the extension easier to maintain and easier to understand.
MVP working.
Apache-2.0