snippets are no longer available via localStorage
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript
- Domain
- devtools
Research direction
Start by locating the snippet persistence code that currently uses localStorage, then read the InspectorFrontendHost.getPreferences and setPreference entry points described in the issue. Done means snippets remain available after the Chrome storage change and existing snippet behavior continues to work.
Written by the indexing model from the issue text.
Description
We made snippets (among other settings) available from incognito. I think this change landed in Chrome stable around 46/47 or so.
As a result, they are no longer available in localStorage. Here's the new technique. These are run from a devtools-on-devtools window.
getting snippets
InspectorFrontendHost.getPreferences(_ => console.log(JSON.parse(_.scriptSnippets)))
setting snippets
InspectorFrontendHost.setPreference("scriptSnippets", JSON.stringify(yourSnippets))
FWIW, InspectorFrontendHost.getPreferences will return everything that has migrated to the incognito-available settings (most things), while a few items (like breakpoints) remain in the devtools' localStorage
Tagging a few other issues that use this technique:
- Dominant language
- JavaScript
- Stars
- 1.8k
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bahmutov/code-snippets
-
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
bahmutov/code-snippets#28 ·
-
Angular snippetsOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
bahmutov/code-snippets#26 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
bahmutov/code-snippets#20 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
bahmutov/code-snippets#13 ·
All issues in bahmutov/code-snippets
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
quarto-dev/quarto-cli#15042 ·
Maintainers usually reply within 1 day
-
OpenCode install copies the Pi harness directory (`.pi/`) into the OpenCode config rootPossibly taken @gaurav0107 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NaturalIntelligence/fast-xml-parser#890 · 1 comment ·
Maintainers usually reply within 3 days
-
Docs viewer: inverted grey colormap, Phantom CT window -20 to 35 HU, smoothing up to 40 mmPossibly taken A pull request linked to this issue is open or already merged. Openarea: docs enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
PyTomography/PyTomography#331 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
pnpm/get.pnpm.io#68 ·