philc / vimium

The hacker's browser.
https://chrome.google.com/webstore/detail/vimium/dbepggeogbaibhgnhhndojpepiihcmeb
MIT License
23.04k stars 2.48k forks source link

Failed to parse options backup #3715

Open erjoalgo opened 3 years ago

erjoalgo commented 3 years ago

I'm unable to load the backup file created by vimium, from the same browser that generated the backup: 27-Nov-2020-20:07:29

This is the vimium-options.json backup file:

{
  "settingsVersion": "1.66",
  "exclusionRules": [
    {
      "pattern": "https://cloud.digitalocean.com/droplets/*/console*",
      "passKeys": ""
    }
    {
      "pattern": "https://youtube.com/watch/*",
      "passKeys": ""
    }
  ],
  "filterLinkHints": false,
  "waitForEnterForFilteredHints": true,
  "hideHud": false,
  "keyMappings": "# Insert your preferred key mappings here.\n\nmap d scrollPageDown\nmap w scrollPageUp\nmap a scrollLeft\nmap s scrollRight\n\nmap , scrollToTop\nmap . scrollToBottom\nmap q LinkHints.activateModeToOpenInNewTab\nmap <f1> previousTab\nmap <f2> nextTab\nmap <f4> removeTab",
  "linkHintCharacters": "1234qwerasdfgzxcvb",
  "linkHintNumbers": "0123456789",
  "newTabUrl": "about:newtab",
  "nextPatterns": "next,more,newer,>,›,→,»,≫,>>",
  "previousPatterns": "prev,previous,back,older,<,‹,←,«,≪,<<",
  "regexFindMode": true,
  "ignoreKeyboardLayout": false,
  "scrollStepSize": 60,
  "smoothScroll": true,
  "grabBackFocus": false,
  "searchEngines": "w: https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s Wikipedia\n\n# More examples.\n#\n# (Vimium supports search completion Wikipedia, as\n# above, and for these.)\n#\n# g: https://www.google.com/search?q=%s Google\n# l: https://www.google.com/search?q=%s&btnI I'm feeling lucky...\n# y: https://www.youtube.com/results?search_query=%s Youtube\n# gm: https://www.google.com/maps?q=%s Google maps\n# b: https://www.bing.com/search?q=%s Bing\n# d: https://duckduckgo.com/?q=%s DuckDuckGo\n# az: https://www.amazon.com/s/?field-keywords=%s Amazon\n# qw: https://www.qwant.com/?q=%s Qwant",
  "searchUrl": "https://duckduckgo.com/?q=",
  "userDefinedLinkHintCss": "div > .vimiumHintMarker {\n/* linkhint boxes */\nbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785),\n  color-stop(100%,#FFC542));\nborder: 1px solid #E3BE23;\n}\n\ndiv > .vimiumHintMarker span {\n/* linkhint text */\ncolor: black;\nfont-weight: bold;\nfont-size: 12px;\n}\n\ndiv > .vimiumHintMarker > .matchingCharacter {\n}"
}
erjoalgo commented 3 years ago

Vimium Version 1.66

lydell commented 3 years ago

There’s a missing comma on line 7. Try this:

{
  "settingsVersion": "1.66",
  "exclusionRules": [
    {
      "pattern": "https://cloud.digitalocean.com/droplets/*/console*",
      "passKeys": ""
    },
    {
      "pattern": "https://youtube.com/watch/*",
      "passKeys": ""
    }
  ],
  "filterLinkHints": false,
  "waitForEnterForFilteredHints": true,
  "hideHud": false,
  "keyMappings": "# Insert your preferred key mappings here.\n\nmap d scrollPageDown\nmap w scrollPageUp\nmap a scrollLeft\nmap s scrollRight\n\nmap , scrollToTop\nmap . scrollToBottom\nmap q LinkHints.activateModeToOpenInNewTab\nmap <f1> previousTab\nmap <f2> nextTab\nmap <f4> removeTab",
  "linkHintCharacters": "1234qwerasdfgzxcvb",
  "linkHintNumbers": "0123456789",
  "newTabUrl": "about:newtab",
  "nextPatterns": "next,more,newer,>,›,→,»,≫,>>",
  "previousPatterns": "prev,previous,back,older,<,‹,←,«,≪,<<",
  "regexFindMode": true,
  "ignoreKeyboardLayout": false,
  "scrollStepSize": 60,
  "smoothScroll": true,
  "grabBackFocus": false,
  "searchEngines": "w: https://www.wikipedia.org/w/index.php?title=Special:Search&search=%s Wikipedia\n\n# More examples.\n#\n# (Vimium supports search completion Wikipedia, as\n# above, and for these.)\n#\n# g: https://www.google.com/search?q=%s Google\n# l: https://www.google.com/search?q=%s&btnI I'm feeling lucky...\n# y: https://www.youtube.com/results?search_query=%s Youtube\n# gm: https://www.google.com/maps?q=%s Google maps\n# b: https://www.bing.com/search?q=%s Bing\n# d: https://duckduckgo.com/?q=%s DuckDuckGo\n# az: https://www.amazon.com/s/?field-keywords=%s Amazon\n# qw: https://www.qwant.com/?q=%s Qwant",
  "searchUrl": "https://duckduckgo.com/?q=",
  "userDefinedLinkHintCss": "div > .vimiumHintMarker {\n/* linkhint boxes */\nbackground: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785),\n  color-stop(100%,#FFC542));\nborder: 1px solid #E3BE23;\n}\n\ndiv > .vimiumHintMarker span {\n/* linkhint text */\ncolor: black;\nfont-weight: bold;\nfont-size: 12px;\n}\n\ndiv > .vimiumHintMarker > .matchingCharacter {\n}"
}

Still, it would be nice if Vimium gave a better error message.