Permissions aren't being loaded for Chrome Extensions - google-chrome

Just started my first chrome extension and I'm trying to use the chrome.bookmarks.getChildren() method. I am getting an error saying
Uncaught Error: You do not have permission to use 'bookmarks.getChildren'. Be sure to declare in your manifest what permissions you need.
My manifest.json file:
{
"manifest_version": 2,
"name": "Top Sites",
"description": "blah blah blah",
"version": "1.0",
"permissions": [
"bookmarks"
],
"browser_action": {
"default_icon": "images/icon.png",
"default_popup": "html/popup.html"
}
}

Related

chrome.action.getUserSettings missing?

I am trying to access the getUserSettings method on the chrome API and always get an error that "property getUserSettings is not defined on typeof action" when trying to call it. Is this method deprecated?
I have listed my manifest.json below, all I am doing is trying to print out the user settings in the background.js file:
chrome.action.getUserSettings((userSettings) => console.log(userSettings));
"name": "test",
"description": "test",
"background": {
"service_worker": "background.js"
},
"manifest_version": 3,
"version": "0.0.1",
"permissions": ["tabs"],
"action": {
"default_icon": {
"16": "icon.png",
},
"default_popup": "popup.html"
}
}
In the documentation the return type of this function is listed as pending, but I have seen many other examples of people using this function in V3 of the manifest without issue, even looking through some of the deprecated features in the chrome blog did not seem to mention this function.

Error processing manifest in firefox

I have developed a extension primarily focused on chrome which works but now i need that extension to work in firefox either so I checked by loading the extension by going to about:debugging page and loading temporary addons. Currently, I go an error. I got error something like this
Reading manifest: Error processing options_page: An unexpected
property was found in the WebExtension manifest.
Reading manifest: Error processing oauth2: An unexpected property
was found in the WebExtension manifest.
Reading manifest: Error processing key: An unexpected property was
found in the WebExtension manifest.
Here is what my manifest file looks like(I removed options_page)
manifest.json
{
"version": "1.0",
"name": "Browser Extension",
"manifest_version": 2,
"description":
"This extension allow the user to select the text and redirect to the application",
"page_action": {
"default_title": "Select Text",
"default_popup": "index.html"
},
"icons": {
"16": "img/browser16.png",
"48": "img/browser48.png",
"128": "img/browser128.png"
},
"background": {
"scripts": ["extension/js/background.js"],
"persistent": true
},
"content_scripts": [
{
"matches": [
"https://mail.google.com/mail/*/*",
"http://mail.google.com/mail/*/*"
],
"js": ["extension/js/jquery.min.js", "extension/js/content.js"],
"css": ["extension/css/main.css"],
"run_at": "document_end"
}
],
"permissions": [
"contextMenus",
"tabs",
"storage",
"webNavigation",
"notifications",
"cookies",
"identity",
"*://mail.google.com/mail/*/*",
"https://www.googleapis.com/*",
"https://*.googleusercontent.com/*"
],
"web_accessible_resources": ["img/browser128.png", "img/ios-link.svg"],
"oauth2": {
"client_id":
"114446495690-8ejpdgvmn8vc9pblteupetas.apps.googleusercontent.com",
"scopes": ["profile", "https://www.googleapis.com/auth/gmail.readonly"]
},
"key":
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnqFjzbt+LtejD1JhOyMUbejOHdLoemzryr+ZQHK2CEKuI0yVVYToFs7eNusH/hfxhnyF27G4BU8apsTc695EpVQGD0ANKdt6BjubRnA/4VcdkmfdD3D9nsdCc+fHkINRU5e05grfs/BETWW/JAUULduaNWGfhT7"
}
How do i resolve above issues to make it firefox compatible as well?

How do I get the checkbox "Allow access to file URLs" to show up next to my app? I have file write permissions in manifest

More Info/Update
I packaged and installed google's own sample app showing filesystem access and it also does not show the checkbox!
You can find it here: https://github.com/GoogleChrome/chrome-app-samples/tree/master/filesystem-access
Original Post
I have the permission asking for filesystem.write ability in my manifest but on the chrome://extensions page, the check box doesn't show up. And when I click "permissions" next to my app's icon, it only shows:
"Write to files that you have opened in the application"
What am I doing wrong? (This is a hosted app)
manifest.json
{
"manifest_version": 2,
"name": "Hello World",
"description": "A test application",
"version": "2.0.3.92",
"minimum_chrome_version": "23",
"offline_enabled": true,
"update_url": "http://mywebsite.com/updates/helloworld.xml",
"icons":
{
"16": "icon_16.png",
"128": "icon_128.png"
},
"app":
{
"background":
{
"scripts":
[
"utils.js",
"fs.js",
"main.js"
]
}
},
"permissions":
[
"unlimitedStorage",
"fullscreen",
{
"fileSystem":
[
"write"
]
},
"background",
"http://*/",
"tabs"
]
}
To get this to work you need either:
permissions: [ "<all_urls>" ]
or a scheme starting with file:///.
If you try *://*/* that will not work as it only represents http or https

Manifest is not valid json Error

I am trying to update my extension but I get following error message. Message clear but there is no line 30. What is the problem?
manifest.json
{
"name": "IdeaShop Information",
"description": "IdeaShop siteleri ile ilgili bilgileri gosterir",
"manifest_version": 2,
"version": "1.0",
"permissions": [
"tabs",
"http://*/*",
"https://*/*"
],
"browser_action": {
"default_title": "IdeaShop Information",
"default_icon": "icon.png",
"popup": "popup.html"
}
]
}
Directory Structure
There seems to be an extra ] at the end.
You can validate your json file at jsonlint.com
An extra square bracket at the last but one line caused the error. The line number displayed in such message is not correct.

'socket' is not allowed for specified package type (theme, app, etc.)

Chrome API for sockets is not working now for me.
I've got following manifest:
{
"name": "My name",
"version": "0.1",
"manifest_version": 2,
"background": {
"page": "background.html"
},
"browser_action": {
"default_icon": "ico16.png",
"default_title": "My extension",
"default_popup": "popup.html"
},
"description": "bla bla bla",
"minimum_chrome_version": "23",
"icons": {
"ico128": "ico128.png",
"ico16": "ico16.png",
"icon_logo": "icon_logo.png"
},
"options_page": "options.html",
"permissions": ["experimental",
{"socket": [
"udp-send-to"
]},
"notifications",
"background"]
}
but following warning it's been displayed when loading the extension:
'socket' is not allowed for specified package type (theme, app, etc.).
I've tested with Version 23.0.1246.0 canary and 23.0.1246.0 dev-m
This is expected behavior, the socket API is only available to packaged apps, and based on the manifest you're working on an extension.
If you will communicate this extension with a NodeJs application, you can use Socket.iO for this. Check how: https://www.thirdrocktechkno.com/blog/node-js-socket-io-chrome-extension-integration/