Skip to content

Repository files navigation

Docs Lookup for DevDocs

Select an API name on any page, right-click, and read the DevDocs entry in a small window beside your work — your original tab is never touched.

Unofficial. Not affiliated with DevDocs or freeCodeCamp.

One permission (contextMenus). No host permissions. It cannot read any page.

Install

Both listings ship the same five-file package; there is no separate Edge build.


Why this exists

DevDocs is a website and a PWA, so most third-party DevDocs clients exist to take it out of the browser — into Vim, Emacs, the terminal, Alfred, Raycast. Inside the browser there is much less to add.

The one thing the browser can do that devdocs.io cannot do for itself is act on a selection on someone else's page. The DevDocs maintainer said as much in issue #1518:

"Changing the context menu requires a browser extension … thus, is out of scope of devdocs."

That is the whole scope of this extension.

Design decisions

A real window, not an in-page overlay. This is the most important decision in the project, and it was made the hard way — v0.1–v0.4.3 were an in-page overlay (an iframe injected into the host page) and it had to be abandoned. DevDocs stores every user preference in a cookie (app/settings.jsnew CookiesStore()), and it sets those cookies without a SameSite attribute, which Chrome treats as SameSite=Lax. Lax cookies are unavailable inside a cross-site iframe, so the embedded DevDocs could not read the documentation sets you had enabled, could not read your offline data, and correctly complained about it on every open (notifCookieBlocked: "DevDocs will not work properly if cookies are disabled."). A top-level window makes devdocs.io first-party again and the whole class of problems disappears. Full reasoning is in the "架构变更史" section at the bottom of background.js.

It uses your own DevDocs setup. Because the window is top-level, your enabled documentation sets, theme and downloaded offline data are all in effect. Searches are scoped to the docs you actually use. Extensions that render DevDocs inside their own popup or frame structurally cannot do this.

No language-scoped search. DevDocs supports a scope prefix (#q=python~3.13 x), but it only works if you have that exact documentation set enabled — and DevDocs ships nine separate Python sets (3.6–3.14) alone. Hard-coding any slug would silently return unrelated results for most users. Your enabled sets are the filter; that is the only design that cannot fail silently.

Reuse, don't stack. Looking up a different word switches the existing window instead of opening a second one. The window handle is kept in memory only — persisting it would need the storage permission, and a one-item permission list is worth more than never opening a stray window.

No permission is spent on convenience. Two features were dropped rather than pay for them: a cut-word warning (would need activeTab + scripting to read the characters adjacent to your selection) and a search-as-you-type popup (would need host permissions to cache the DevDocs index). Both are noted in background.js.

Complements popup-based extensions

This extension Popup-based DevDocs extensions
Trigger Right-click on a selection Keyboard shortcut, type a query
Use case "I hit a word I don't recognise while reading" "I want to look something up right now"
Where results appear Small top-level window Extension popup
Respects your DevDocs preferences yes (first-party context) no (cookies unavailable to them)
Host permissions none typically required to cache the search index

They do not overlap. Installing both is reasonable.

Known boundaries

background.js documents the conditions under which this thing degrades. The one worth knowing before you file a bug: DevDocs treats a case-insensitive substring match anywhere in an identifier as a hit and jumps straight to the best-scoring entry, so a sloppy selection can land you on a plausible-looking wrong page (selecting ethe out of together matches offs[etHe]ight). Short selections are the risky ones; long ones fail loudly by returning nothing.

Development

# load unpacked
chrome://extensions -> Developer mode -> Load unpacked -> this folder

# regenerate icons (edit BG / FG / ACCENT to change colours)
python make_icons.py

# turn raw screenshots into store-ready 1280x800 images
python make_store_screenshots.py

# build the uploadable zip (5 files; refuses to build if the manifest regains
# content_scripts, web_accessible_resources or host_permissions)
python build.py

archive/ holds the abandoned iframe-overlay implementation. It is kept for the notes in it — two instructive failures are documented there — and is excluded from the build. See archive/README.md.

Licence

MIT — see LICENSE. DevDocs itself is MPL-2.0 by Thibaut Courouble and contributors.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages