We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fbff9ac commit ecdd84cCopy full SHA for ecdd84c
update-code-snippets.js
@@ -1,6 +1,12 @@
1
// updates code snippets from remote repo
2
-// See README.md
3
-var snippets = JSON.parse(localStorage.scriptSnippets);
+// needs to run in the secondary DevTools window (undocked)
+// see "Updating local code snippets"
4
+var source = localStorage.scriptSnippets;
5
+if (typeof source === 'undefined') {
6
+ throw new Error('Cannot find scriptSnippets, are you running in the secondary DevTools?\n' +
7
+ 'see https://github.com/bahmutov/code-snippets#updating-local-code-snippets');
8
+}
9
+var snippets = JSON.parse(source);
10
console.log('I have', snippets.length, 'code snippets');
11
console.table(snippets);
12
0 commit comments