Note that there are some explanatory texts on larger screens.

plurals
  1. POChrome Manifest.json syntax error
    primarykey
    data
    text
    <p>I am working on a chrome app and its basically done, however I am adding code to my customer's website to have it determine if the app is installed on chrome or not.</p> <p>In order to do this I need to check for a file "manifest.json" is available for the app to determine if its installed or not.</p> <p>I am using the below code that I got from another posted question on here:</p> <pre><code>function detectChromeExtension(extensionId, accesibleResource, callback){ if (typeof(chrome) !== 'undefined'){ var xmlHttp = new XMLHttpRequest(), testUrl = 'chrome-extension://' +extensionId +'/' +accesibleResource; xmlHttp.open('HEAD', testUrl, true); xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded'); xmlHttp.timeout = 1000; xmlHttp.onreadystatechange = function() { if (xmlHttp.readyState == 4 &amp;&amp; typeof(callback) == 'function') { if (xmlHttp.status == 200) { callback.call(this, true); } else { callback.call(this, false); } } } xmlHttp.ontimeout = function() { if (typeof(callback) == 'function') callback.call(this, false); } xmlHttp.send(); } else { if (typeof(callback) == 'function') callback.call(this, false); } }; detectChromeExtension('gcjbmhbihobfgpjmfbooldocijijdpig', 'manifest.json', myCallbackFunction); function myCallbackFunction(extensionExists) { if (extensionExists){ console.log('Extension present'); } else { console.log('Extension not present'); } } </code></pre> <p>By checking the chrome console I am getting the following output:</p> <p>Denying load of chrome-extension://gcjbmhbihobfgpjmfbooldocijijdpig/manifest.json. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.</p> <p>so to fix this I am trying to add "web_accessible_resources": ["manifest.json"] into my manifest.json but it tells me that this line doesn't follow syntax.</p> <p>Here is the full manifest.json:</p> <pre><code>{ "name": "Watch TBR", "version": "1.0", "manifest_version": 2, "default_locale": "en", "description": "Easy access to WatchTBR.com", "icons": { "128": "icon_128.png", "16": "icon_16.png" }, "app": { "urls": [ "http://www.watchtbr.com/" ], "launch": { "web_url": "http://www.watchtbr.com/" } }, "web_accessible_resources": ["manifest.json"], "permissions":["http://www.watchtbr.com"] } </code></pre> <p>Any help on this is greatly appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload