code-snippets icon indicating copy to clipboard operation
code-snippets copied to clipboard

update-code-snippets.js not working in Chrome 45.0.2454.101

Open jimmygchen opened this issue 9 years ago • 2 comments

I'm getting the following error when running the snippet update-code-snippets.js to update my snippets: Cannot find scriptSnippets, are you running in the secondary DevTools? see https://github.com/bahmutov/code-snippets#updating-local-code-snippets

My Chrome version is 45.0.2454.101 m.

I ran the snippet from the 2nd DevTools instance (following the steps in documentation) but it doesn't work - scriptSnippets key doesn't exist in localStorage. It seems that scriptSnippets are no longer stored in localStorage?

My temporary workaround to this problem is to modify the update-code-snippet.js (not nice but works for me atm): https://gist.github.com/jchen86/3ca08af721a43725ebf6

jimmygchen avatar Oct 13 '15 05:10 jimmygchen

Looks like Chrome removed snippets access from dev tools local storage. This https://developers.google.com/web/tools/chrome-devtools/debug/snippets/#map-snippets-to-external-files-via-workspaces says one can map snippets to folder on a disk but i could not recreate that. Only thing that was working was to create a Workspace that points to my folder with git repository (with snippets). But files from that folder do not display in Snippets tab, only in Sources tab and cannot be run :( And those files are not carried with my Chrome installations on different machines.

@jchen86 looks like WebInspector.scriptSnippetModel._snippetStorage.snippets(); no longer works in current Chrome distribution. I could not find what is the new way of accessing snippets in Chrome.

hoto avatar Jan 21 '16 14:01 hoto

Might be same as #23

bahmutov avatar Apr 02 '16 13:04 bahmutov