2

(所以,我是一個平面設計師/藝術家,我是新來的任何類型的代碼或腳本)。設計Chrome主題,出了什麼問題?

在我的Chrome主題的代碼,我得到一個錯誤:

"Could not load extension from 'E:\Web\dev\theme\dev\Test'. Manifest is not valid JSON. Line: 7, column: 4, Syntax error."

我不知道我要去哪裏錯了,因爲指定的語法錯誤是在一片空白,如該代碼示例:

{ 
     "manifest_version": 2, 
     "version": 2.0 
     "name": "Test", 
     "theme": { 
      "images" : { 
      "theme_frame" : "images/frame.png", 
      "theme_toolbar" : "images/toolbar.png", 
      "theme_ntp_background" : "images/polygons.png", 
      "theme_tab_background" : "images/tab.png", 
      "theme_ntp_attribution" : "images/theme_ntp_attribution.png" 
     }, 
     "colors" : { 
      "ntp_link": [255,255,255], 
     "ntp_text": [255,255,255], 
     "ntp_section_link": [255,255,255], 
     "ntp_section_text": [10 , 17 , 27], 
     "ntp_background": [10 , 17 , 27], 
     "frame": [10 , 17 , 27], 
     "toolbar": [10 , 17 , 27], 
     "tab_text": [255,255,255], 
     "tab_background_text": [10 , 17 , 27], 
     "bookmark_text": [255,255,255] 
     }, 
     "tints" : { 
        "buttons" : [0.33, 0.5, 0.47] 
     }, 
     "properties" : { 
      "ntp_background_alignment" : "bottom", 
     "ntp_background_repeat": "no-repeat" 
     } 
     } 
    } 

所以,當上午回事?

回答

1

你忘了把逗號線

"version": 2.0 

順便說一句,你可以使用JSONLint驗證JSON。

+0

@peter所以,我添加了逗號,但現在的錯誤信息是: >無法從'E:\ Web \ dev \ theme \ dev \ Test'加載擴展名。必需的值'版本丟失或無效。它必須介於0到65536之間的1-4個點分隔的整數之間(這是當前狀態):「manifest_version」:2, 「版本」:2.0, 「name」:「Test」 ,等' – ynfnitysquared 2013-03-07 22:14:03

+1

試着把2.0換成引號。 – 2013-03-07 23:05:38

+0

好的,謝謝,它工作,很棒的工作。 – ynfnitysquared 2013-03-08 17:05:11