Skip to content

Commit ab89f85

Browse files
committed
combine the search archive tools
1 parent 1ba0993 commit ab89f85

35 files changed

Lines changed: 2352 additions & 327 deletions

.github/workflows/test.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
name: test
2-
on: [push, pull_request]
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
permissions:
8+
contents: read
9+
310
jobs:
411
test:
512
runs-on: ubuntu-latest
613
steps:
714
- uses: actions/checkout@v4
815
- uses: actions/setup-node@v4
916
with:
10-
node-version: '20'
11-
- run: node core.test.js
17+
node-version: 22
18+
- uses: actions/setup-python@v5
19+
with:
20+
python-version: "3.12"
21+
- run: node tests/core.test.js
22+
- run: node tests/content.test.js
23+
- run: python scripts/package.py
24+
- run: python tests/site.test.py
25+
- run: python tests/package.test.py

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
*.zip
1+
dist/
2+
__pycache__/
3+
*.py[cod]
4+
.DS_Store
5+
Thumbs.db

MAINTENANCE.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Maintenance notes
2+
3+
Search Restore changes a page it does not control. Keep these assumptions in the
4+
release checklist.
5+
6+
## Current Google result structure
7+
8+
On August 23, 2026, a read-only browser check of
9+
`https://www.google.com/search?q=example&hl=en&gl=us&pws=0` returned:
10+
11+
- one `#rso` result container;
12+
- seven `h3` elements with a closest external link;
13+
- one `.MjjYud` wrapper per linked result;
14+
- no unusual-traffic or captcha page.
15+
16+
The extension uses `#rso` and linked `h3` elements as its main result signals.
17+
`.MjjYud` is only the preferred pagination wrapper. A generic single-heading
18+
ancestor is the fallback because generated Google class names can change.
19+
20+
The production `core.js` and `content.js` files were also run in a fresh
21+
logged-out tab. They added seven archive rows and one load control. One click
22+
fetched `start=10`, found nine new result blocks, raised the linked-title count
23+
from 7 to 16 and changed the button to `Load results 21-30`.
24+
25+
That test found a false block signal in the first detector: Google's normal page
26+
scripts contain literal `/sorry/index` checks. `looksBlocked()` now strips script
27+
and style blocks before using its HTML fallback. The response status and an
28+
actual redirect to `/sorry/` remain the primary checks in `content.js`.
29+
30+
## Known failure cases
31+
32+
The extension intentionally does nothing when `/search` has no `#rso` block.
33+
This includes some AI Mode, consent and zero-result layouts. A Google captcha or
34+
HTTP 429 stops pagination and leaves a status message. The extension does not
35+
attempt to bypass those checks.
36+
37+
If Google removes `start=` pagination, the load-more feature cannot reconstruct
38+
pages that Google no longer serves. If result titles stop using linked `h3`
39+
elements, archive rows will need a new reviewed selector.
40+
41+
## Release check
42+
43+
Use an unsigned, logged-out browser profile. Confirm `#rso`, linked `h3` titles,
44+
archive-row placement and one next-page fetch. Check a normal web query and a
45+
query with an AI Overview. Record limitations instead of marking an untested
46+
layout as working.

PRIVACY.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Privacy
2+
3+
Search Restore does not collect, sell or transmit personal data. It has no
4+
analytics, advertising, account system or remote server.
5+
6+
The extension reads result titles and destination URLs already displayed on a
7+
supported Google Search page. It uses them to add archive links and does not
8+
keep a search history. The load-more feature requests the next Google results
9+
page only after the user presses its button.
10+
11+
The extension stores the `archiveLinks` and `loadMore` preferences with
12+
`chrome.storage.local`. Chrome keeps these settings on the device instead of
13+
placing them in Chrome Sync.
14+
15+
## Chrome Web Store Limited Use
16+
17+
Search Restore's use of information received from Chrome APIs follows the
18+
Chrome Web Store User Data Policy, including its Limited Use requirements.
19+
Search result titles and destination URLs are used only to provide the visible
20+
archive and result-loading features the user installed. They are not retained,
21+
sold, used for advertising, or transferred to another party except when the
22+
user deliberately opens an archive link.
23+
24+
Archive sites receive a result URL only when the user chooses an archive link.
25+
Those sites have their own privacy policies.
26+
27+
Effective August 23, 2026.

README.md

Lines changed: 61 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,84 @@
1-
# Return Google Cache
1+
# Search Restore
22

3-
Google removed the Cached link from search results in 2024. This puts a working
4-
one back on every result, pointed at the Wayback Machine and archive.today.
3+
Search Restore combines two Google Search repairs in one Chrome extension:
4+
archive links under normal results and a button that loads later result pages
5+
into the current list.
56

6-
[![Ko-fi](https://img.shields.io/badge/Ko--fi-buy_me_a_coffee-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/jju1s)
7-
[![License](https://img.shields.io/badge/license-MIT-blue?style=flat-square)](LICENSE)
8-
[![Tests](https://img.shields.io/github/actions/workflow/status/cig13zs/return-google-cache/test.yml?style=flat-square&label=tests)](https://github.com/cig13zs/return-google-cache/actions)
7+
[![Ko-fi](https://img.shields.io/badge/Ko--fi-support-FF5E5B?style=flat-square&logo=ko-fi&logoColor=white)](https://ko-fi.com/jju1s)
8+
[![License](https://img.shields.io/badge/license-MIT-17324d?style=flat-square)](LICENSE)
9+
[![Tests](https://img.shields.io/github/actions/workflow/status/cig13zs/search-restore/test.yml?style=flat-square&label=tests)](https://github.com/cig13zs/search-restore/actions)
910

10-
**[cig13zs.github.io/return-google-cache](https://cig13zs.github.io/return-google-cache/)**
11+
## Features
1112

12-
For about twenty years every Google result had a Cached link. One click to see
13-
the page as Google last saw it, which was the thing you reached for when a page
14-
was down, paywalled, changed or gone. Google retired it. This adds it back using
15-
the Internet Archive.
13+
Archive links can open the latest Wayback Machine capture, check archive.today
14+
or save the live page. The load-more button requests one Google result page per
15+
click and stops near 100 results.
1616

17-
Under each result you get a small row:
17+
Each feature has its own switch. The switches default to on and are stored with
18+
`chrome.storage.local`.
1819

19-
```
20-
↻ Cached · archive.today · save now
21-
```
20+
## Install
2221

23-
Cached is the latest Wayback Machine snapshot, archive.today is its independent
24-
mirror, and save now archives the live page immediately.
22+
1. Download the release ZIP and extract it.
23+
2. Open `chrome://extensions` and turn on Developer mode.
24+
3. Choose Load unpacked and select the extracted folder.
25+
4. Open a supported Google search page.
2526

26-
## No server, no tracking
27+
The ZIP puts `manifest.json` at its root, so the extracted folder is the one to
28+
select. Chrome, Edge, Brave and Opera can load MV3 extensions this way.
2729

28-
It reads the result links already rendered on your screen and builds archive
29-
URLs locally. It opens no connection of its own, has no analytics, and declares
30-
no `permissions` key. It runs on Google search pages and can do nothing else.
30+
## Scope and privacy
3131

32-
## Install
32+
The manifest declares only the `storage` permission. It has no
33+
`host_permissions` key. Its content script is limited to the HTTPS `/search`
34+
path on the Google domains listed in `manifest.json`, with a second runtime
35+
check that requires `location.pathname === '/search'`.
3336

34-
Not on the Chrome Web Store yet, so load it unpacked. Works in Chrome, Edge,
35-
Brave and Opera.
37+
Chrome may describe that content-script scope as permission to read and change
38+
data on the listed Google sites. That access is what lets Search Restore inspect
39+
the visible result links and add controls to the search page; it does not cover
40+
other sites or other Google paths.
3641

37-
1. Download the latest zip from [Releases](https://github.com/cig13zs/return-google-cache/releases) and unzip it.
38-
2. Open `chrome://extensions`, turn on Developer mode.
39-
3. Load unpacked, then pick the `extension` folder.
40-
4. Search Google. The Cached links are there.
42+
There is no analytics or extension server. The two switches stay in local
43+
extension storage. Google receives a request only when the user presses the
44+
load-more button. An archive service opens only after the user chooses its link.
45+
See [PRIVACY.md](PRIVACY.md) for the full policy.
4146

42-
## Files
47+
## Build and test
4348

44-
```
45-
extension/
46-
manifest.json MV3, runs only on google search pages
47-
core.js cacheLinks() + enhance(), works in browser and Node
48-
content.js injects styling, runs enhance(), re-runs as results stream in
49-
popup.html toolbar popup
50-
icons/
51-
core.test.js node core.test.js
52-
```
49+
Node and Python are enough for the release checks.
5350

54-
```bash
55-
node core.test.js
51+
```text
52+
node tests/core.test.js
53+
node tests/content.test.js
54+
python scripts/package.py
55+
python tests/site.test.py
56+
python tests/package.test.py
5657
```
5758

58-
The result walk is anchored on each result's `<h3>` title and then its link,
59-
rather than on Google's build-hashed class names, so a redesign doesn't silently
60-
break it.
61-
62-
## Limits
59+
`scripts/package.py` writes a sorted ZIP with fixed timestamps, then writes its
60+
SHA-256 checksum. `tests/package.test.py` builds twice in temporary directories
61+
and compares the bytes.
6362

64-
Covers the main Google TLDs (com, co.uk, ca, de, fr, in, br, ph, jp and others).
65-
If your local Google domain isn't in the manifest, add one line and reload.
63+
## Google markup limits
6664

67-
Archives don't have every page. If the Wayback Machine never captured a URL its
68-
snapshot page says so, and you can use save now to capture it going forward.
65+
This extension is a page repair, not an official Google API client. The archive
66+
feature looks for result title links under `#rso`. Pagination uses the `start`
67+
query parameter and extracts result blocks from the next page. Google can change
68+
either behavior without notice.
6969

70-
Reads organic result links only. Ads, Google's own properties and image
71-
thumbnails are skipped.
70+
A read-only check on August 23, 2026 found one `#rso` container and seven linked
71+
`h3` result titles for the query `example`. The same check found no captcha. See
72+
[MAINTENANCE.md](MAINTENANCE.md) for the selectors and failure cases that need
73+
watching.
7274

73-
## More tools
75+
## Files
7476

75-
- [Carryover](https://github.com/cig13zs/carryover), AI chat context transfer for ChatGPT, DeepSeek and Grok
76-
- [Invisibles](https://github.com/cig13zs/invisibles), reveal and strip hidden Unicode from text
77-
- [Rinse](https://github.com/cig13zs/rinse), see the GPS in a photo and wash it off
78-
- [Return 100 Results](https://github.com/cig13zs/return-100-results), browse ~100 Google results as one page
77+
```text
78+
extension/ Chrome MV3 package source
79+
scripts/package.py deterministic ZIP and checksum builder
80+
store-assets/ Chrome Web Store artwork and screenshots
81+
tests/ core, content, manifest, page and package checks
82+
```
7983

80-
Not affiliated with Google or the Internet Archive. MIT licensed.
81-
[Ko-fi](https://ko-fi.com/jju1s) if you want to.
84+
Not affiliated with Google, the Internet Archive or archive.today. MIT licensed.

STORE-LISTING.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Chrome Web Store listing
2+
3+
## Name
4+
5+
Search Restore
6+
7+
## Summary
8+
9+
Add archive links to Google results and load later result pages into the same list.
10+
11+
## Description
12+
13+
Search Restore puts two optional controls on supported Google Search pages.
14+
15+
Archive links appear under normal web results. They open the latest Wayback
16+
Machine capture, archive.today or the Internet Archive save page.
17+
18+
The load-more button requests the next Google results page and places its normal
19+
results below the current list. It loads one page per click and stops near 100
20+
results, when no more results are found or when Google asks for verification.
21+
22+
Both features have separate on/off switches. Preferences stay in local Chrome
23+
extension storage. Search Restore has no analytics, advertising, account system
24+
or extension server.
25+
26+
Google page markup changes over time, so some result layouts may not be handled.
27+
The project documents its current selectors and tests in the public repository.
28+
29+
Search Restore is not affiliated with Google, the Internet Archive or
30+
archive.today.
31+
32+
## Category
33+
34+
Tools
35+
36+
## Permission justification
37+
38+
`storage` saves the two feature switches on the device. No other named
39+
permission is requested. The content script is declared only for the listed
40+
HTTPS Google Search paths and the manifest has no separate `host_permissions`.
41+
Chrome may still describe that declared content-script scope as access to the
42+
listed Google sites; reading and updating the visible results page is the
43+
extension's single purpose.
44+
45+
## Privacy policy
46+
47+
https://cig13zs.github.io/search-restore/privacy.html

core.test.js

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)