Can someone correct my Json Code ? - json

I'm trying to do a Extension for Google Chrome and I receive the error : Unexpected Token
Thanks to everyone who will reply :D
http://i.gyazo.com/0e435fdc4d9432789834560a594480ab.png
This is my code :
}
“manifest_version”: 2,
“name”: “tf1“,
“description”: “La chaine TF1 en direct“,
“version”: “1.0″,
“icons”: {
“128″: “128.png”
},
“app”: {
“urls”: [
"http://www.tf1.fr/live/"
],
“launch”: {
“web_url”: “http: //www.tf1.fr/live/”
}
},
“permissions”: [
"unlimitedStorage",
"notifications"
]
}

Well, it should open with { instead of }.

Your JSON should begin with a {
The quote characters seem like they were copied from somewhere. The JSON linter did not recognize it to be a valid quote character.
Fixing both:
{
"manifest_version": 2,
"name": "tf1",
"description": "LachaineTF1endirect",
"version": "1.0",
"icons": {
"128": "128.png"
},
"app": {
"urls": [
"http://www.tf1.fr/live/"
],
"launch": {
"web_url": "http: //www.tf1.fr/live/"
}
},
"permissions": [
"unlimitedStorage",
"notifications"
]
}
When you are not sure if your JSON is correctly formed, use this tool - JSONLint. It tells you why your JSON is malformed.

JSON should be opened with { and closed with }.
I think your problem is in quotes symbols.
You have to use ", but you using “. I am not sure it is correct.
I assume, this will work:
{
"manifest_version": 2,
"name": "tf1",
"description": "La chaine TF1 en direct",
"version": "1.0",
"icons": {
"128": "128.png"
},
"app": {
"urls": [
"http://www.tf1.fr/live/"
],
"launch": {
"web_url": "http: //www.tf1.fr/live/"
}
},
"permissions": [
"unlimitedStorage",
"notifications"
]
}
You can try it here: http://jsonlint.com/

Related

"Encountered unsupported property Type" Error in Cloudformation with Route53

When attempting to build a AWS::Route53::RecordSet using cloudformation, I get "Encountered unsupported property Type" error. I am assuming this means it does not recognize "Type": "A" in my JSON. However, that is a valid property of AWS::Route53::RecordSet and is even in the example AWS gives in the documentation. (I understand this is for RecordSetGroup, but the example at the bottom builds a RecordSet).
I have also tried copying and pasting the exact example Amazon gives and subbing out their values for mine. Still no luck.
Here is my code:
"DNS" : {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneName": {
"Ref": "HostedZoneName"
},
"Comment": "DNS name for my instance.",
"Name": {
"Fn::Join": [
"",
[
{
"Ref": "ComponentDNSName"
},
{
"Ref": "HostedZoneName"
}
]
]
},
"Type": "A",
"TTL": "900",
"ResourceRecords": [
{
"Fn::GetAtt": [
{
"Fn::GetAtt": [
"Ec2Instance",
"PrivateIp"
]
}
]
}
]
}
}
I thought it might be brackets in the wrong places, but I have double checked that and other resources in my stack (alarms, EC2Instance) build fine.
Thank you for any help.
The issue is with ResourceRecords I think. Replace the current one with
"ResourceRecords": [
{
"Fn::GetAtt": [
"Ec2Instance",
"PrivateIp"
]
}
]
If you have multiple inputs to be added to ResourceRecords, it will become
"ResourceRecords": [
{
"Fn::GetAtt": [
"name1",
"resource1"
]
},
{
"Fn::GetAtt": [
"name2",
"resource2"
]
}
]
Hope this helps.

my manifest.json file contains an error that I can't find

I'm writing a very simple Chrome extension and when I try to load it as an unpacked extension, I get the following error:
Manifest is not valid JSON. Line: 16, column: 2, Syntax error.
{
"manifest_version": 2,
"name": "Backchannel",
"description": "",
"version": "1.0",
"icons": {
"128": "128.png"
},
"app": {
"urls": [
"http://backchannel.glitch.me/"
],
"launch": {
"web_url”: “http://backchannel.glitch.me/"
}
},
"permissions": [
"unlimitedStorage",
"notifications"
]
}

Ammending Google Managed Preferences via the master_preferences JSON file

I am trying to set up an environment where the first time a user logs into chrome they have a list of pre-determined bookmarks and extensions installed. I have followed Chromiums guide to this as much as possible however seem to be failing when it comes to the granted_permissions section, in an ideal world the user would open Chrome and not be prompted with "This extension requires new permissions". From what i can gather this is through the granted_permissions entry however these do not appear to be parsing through to chrome, ive included a snapshot of the code below:
{
"homepage": "MY_URL",
"homepage_is_newtabpage": false,
"extensions": {
"settings": {
"hdokiejnpimakedhajhdlcegeplioahd": {
"location": 1,
"manifest": {
"key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCiL9y2jziKp5kjb13uYG1bAXsuemUKAYUAwR/N9qTuhMIuly02Ecm63dOkn+M2r26IGfDE/lbPv/dB/W+d34pqGo5uJJY+Omt9t3xsIuz7mQwuvF1H5ozj0OHok5XDFRaBIfPa06RhQw3M7sSZJvQ+qqD3+dr0aLX+mvi0LQ11uQIDAQAB",
"name": "LastPass",
"update_url": "http://clients2.google.com/service/update2/crx",
"granted_permissions": {
"api": [ "contextMenus", "idle", "notifications", "tabs", "unlimitedStorage", "webRequest", "webRequestBlocking" ],
"explicit_host": [ "http://*/*", "https://*/*" ],
"scriptable_host": [ "file:///*", "http://*/*", "https://*/*", "https://1min-ui-prod.service.lastpass.com/*" ]
},
"version": "0.0"
},
"path": "hdokiejnpimakedhajhdlcegeplioahd\\0.0",
"state": 1
},
"cjpalhdlnbpafiamejdnhcphjbkeiagm": {
"location": 1,
"manifest": {
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmJNzUNVjS6Q1qe0NRqpmfX/oSJdgauSZNdfeb5RV1Hji21vX0TivpP5gq0fadwmvmVCtUpOaNUopgejiUFm/iKHPs0o3x7hyKk/eX0t2QT3OZGdXkPiYpTEC0f0p86SQaLoA2eHaOG4uCGi7sxLJmAXc6IsxGKVklh7cCoLUgWEMnj8ZNG2Y8UKG3gBdrpES5hk7QyFDMraO79NmSlWRNgoJHX6XRoY66oYThFQad8KL8q3pf3Oe8uBLKywohU0ZrDPViWHIszXoE9HEvPTFAbHZ1umINni4W/YVs+fhqHtzRJcaKJtsTaYy+cholu5mAYeTZqtHf6bcwJ8t9i2afwIDAQAB",
"name": "uBlock Origin",
"update_url": "http://clients2.google.com/service/update2/crx",
"version": "0.0"
},
"path": "cjpalhdlnbpafiamejdnhcphjbkeiagm\\0.0",
"state": 1
}
}
},
"session": {
"restore_on_startup": 1,
"startup_urls": [
"MY_URL/"
]
},
"browser": {
"show_home_button": true,
"check_default_browser": false
},
"bookmark_bar": {
"show_on_all_tabs": true
},
"distribution": {
"show_welcome_page": false,
"skip_first_run_ui": true,
"import_history": false,
"import_bookmarks_from_file": "/Library/Google/bookmarks.html",
"import_bookmarks": false,
"import_home_page": false,
"import_search_engine": false
},
"sync_promo": {
"user_skipped": true
}
}
After opening chrome even with those permissions in place it still disables the extensions pending further permissions however im not really sure what else its after.
Wrong structure. If you look at the docs, it should be as follows:
{
"extensions": {
"settings": {
"mihcahmgecmbnbcchbopgniflfhgnkff": {
"location": 1,
"manifest": {
...
},
"granted_permissions": {
"api": [ "tabs" ],
"explicit_host": [ "http://*.google.com/*", "https://*.google.com/" ],
"scriptable_host": [ "http://example.com/" ]
},
...
},
...
}
}
}
However, you have put the "granted_permissions" key inside, and not on the same level as the "manifest" key.

alert/confirm doesn't work in chrome app - missing config?

I made a chrome app to display my web by webview tag, but the js API alert()/confirm() doesn't work. That made me wondering. Chrome app needs to config something to support confirm?
this is my manifest.json:
{
"app": {
"background": {
"scripts": ["background.js"]
}
},
"manifest_version": 2,
"name": "Performance Monitor",
"version": "1.0",
"description": "A performance monitor to show cpu and memory status.",
"icons": {
"16": "img/ccloud.png",
"48": "img/ccloud.png",
"128": "img/ccloud.png"
},
"permissions": [
"webview"
],
"webview": {
"partitions": [
{
"name": "static",
"accessible_resources": ["header.html", "footer.html", "static.png"]
},
{
"name": "trusted*",
"accessible_resources": ["local_*.html", "*.png", "*.js"]
},
{
"name": "trusted-audio",
"accessible_resources": ["*.mp3"]
}
]
}
}

Converting Chrome app manifest from V1 to v2

I have made a chrome app in manifest version 1 with the code :
{
"name": "J-Tech",
"version": "2",
"icons": { "128": "icon.png" },
"app": {
"urls": [
"http://www.j-tech-web.co.uk"
],
"launch": {
"web_url": "http://www.j-tech-web.co.uk"
}
}
}
I can't find a tutorial to make it take me the my website, can anyone tell me how
This should work
{
"name": "J-Tech",
"description": "sample Text",
"version": "2",
"manifest_version": "2",
"icons":
{
"128": "icon.png"
},
"app":
{
"urls":
[
"http://www.j-tech-web.co.uk"
],
"launch":
{
"web_url": "http://www.j-tech-web.co.uk"
}
},
"permissions":
[
]
}