using web cam in chrome extension - google-chrome

im trying to create a chrome extension for my company's web app, but upon reading the docs i couldnt find any permission or chrome api that allows a chrome extension to access the webcam, all i could see were permissions to record screens. is there anyway a chrome extension can access a users webcam? or i would have to look for other means.
my manifest.json:
{
"name": "Intaclips",
"description": "Intaclips chrome extension for intaviewer",
"version": "0.1.0",
"manifest_version": 2,
"icons":{
"19": "./icons/icon-19.png",
"32": "./icons/icon-32.png",
"48": "./icons/icon-48.png",
"128": "./icons/icon-128.jpg"
},
"background": {
"scripts": ["./background.js"]
},
"options_page": "./options.html",
"browser_action": {
"default_popup": "popup.html"
},
"permissions": [
"tabs",
"unlimitedStorage",
"activeTab",
"clipboardWrite",
"cookies",
"storage",
"https://www.app.intaviewer.com/*",
"https://www.google.com/*",
"https://www.linkedin.com/*"
],
"content_security_policy": "script-src 'self' https://static.opentok.com/v2/js/opentok.min.js; object-src 'self'"
}
Help in solving this issue will be well appreciated

I think you have to use a third party library like "p5.js"

Related

Chrome extension is corrupted

I have problem with my extension. It is working for me unpacked and when I download it from Chrome store.
However, some users reported that after update extension is corrupted. That's happen after they update it to newer version.
Difference between old and new version is background page and some logic.
I was able to replicate that issue, by packing extension and than drop it into extensions tab. After that I saw the same message as extension users. I also tried that with another extensions and everything worked fine, so maybe there is some issue in manifest file.
{
"manifest_version": 2,
"name": "Cryptocurrency Price Tracker",
"description": "This simple extension allows you to track price changes of Bitcoin and other cryptocurrencies.",
"version": "2.5",
"icons": {
"16":"icon16.png",
"48":"icon48.png",
"128":"icon128.png"
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"options_ui": {
"page": "options.html",
"chrome_style": true
},
"background": {
"scripts": ["background.js"]
},
"permissions": [
"storage",
"notifications",
"https://api.coinmarketcap.com/v1/*"
]
}
I use background page, not event page. So maybe I should add something in the manifest...
P.S. Packaging doesn't work for older version of extension... One more important thing. Users reported that after clicking on options page they saw that error. It didnt happend in my case, when I drag and drop extension file, I saw error immediately.
You need to put in a link to an update url in the manifest. The problem was mentioned in this forum:
https://productforums.google.com/forum/?hl=en#!topic/chrome/kGgLwnrDKpQ;context-place=forum/chrome
So you add update_url into your manifest. It can be any valid url if you are not making use of the feature. So like this:
"name": "Cryptocurrency Price Tracker",
"description": "This simple extension allows you to track price changes of Bitcoin and other cryptocurrencies.",
"version": "2.5",
"icons": {
"16":"icon16.png",
"48":"icon48.png",
"128":"icon128.png"
},
"browser_action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"options_ui": {
"page": "options.html",
"chrome_style": true
},
"background": {
"scripts": ["background.js"]
},
"permissions": [
"storage",
"notifications",
"https://api.coinmarketcap.com/v1/*"
],
"update_url": "http://www.example.com/update.xml"

Chrome extension on a new tab

Is it possible to open your chrome extension on a new tab? I would like to be able to create a chrome browser that has same approach like the bookmark manager. See figure 1.0 below
I would like my application to like/have an address
chrome://personalize_calendar_stuff
is that possible? I can't find on the manifest references.
Thanks to #wOxxOm for giving me an idea.
I added this script on my index.js
chrome.browserAction.onClicked.addListener(function(){
chrome.tabs.create({url: "main.html"});
})
and on below is an example of manifest file I used.
{
"name" : "Testing Chrome",
"version": "1.0",
"background":
{
"scripts": ["index.js"]
},
"description": "A testing example app",
"permissions":[
"tabs",
],
"content_security_policy": "script-src 'self'; object-src 'self'",
"browser_action": {
"default_title": "testing chtome",
"default_icon": "icon.png"
},
"manifest_version": 2
}

I'm having an issue with my google chrome extension, new to code so be basic please

I'm trying to make a google chrome extension, but I'm having a problem. Please answer as basic as possible as I'm really bad at code. Whenever I upload something as a zip file, it says
"An error occurred: Failed to process your item. manifest.json:5:26:
unexpected char."
This is my code :
{
"name": "ROBLOX Character Asset ID",
"version": "1.9.0", // version
"manifest_version": 2,
"description": "This extension is for GFX artists who need their customer's character asset ID",
"browser_action": {
"default_icon": "icon.png"
},
"permissions": [
"alarms",
"background",
"debugger",
"notifications",
"cookies",
"https://www.roblox.com/"
],
"background": {
"scripts": ["bgWork.js", "jQuery-ver3.js"]
},
"icons": { "16": "icon.png",
"48": "icon.png",
"128": "icon.png" }
}
This has to do with the content in your scripts and when you load the extension it not being able to be processed as I loaded your manifest.json just fine (though with blank js files). So don't look towards your manifest.json, you must have an illegal character in your js file.

Dropbox API from Chrome extension: Denying load of chrome-extension://[...]

I'm having trouble integrating the Dropbox API with a Chrome extension. Upon trying to authenticate the Dropbox, the redirect to the Dropbox confirmation/permission page works just fine, but the redirect back to the Chrome app fails. This is the error in the console:
Denying load of chrome-extension://mlabibnomhfmephibijgghejmmmbigpi/chrome_oauth_receiver.h…sGbCG&token_type=bearer&uid=14169733&state=oas_hquvrf6k_0.ycudjb24vysexw29. Resources must be listed in the web_accessible_resources manifest key in order to be loaded by pages outside the extension.
It seems that Chrome is preventing Dropbox from redirecting back to a page within the extension. Several hours of experimenting with permissions have yielded nothing.
Here's the manifest.json:
{
"name": "MyApp",
"description": "Description",
"version": "1.0",
"icons": {"16":"icon.png",
"48":"icon.png",
"128":"icon.png"},
"manifest_version": 2,
"permissions": [
"http://*/*",
"https://*/*",
"<all_urls>",
"tabs",
"storage",
"background",
"bookmarks",
"clipboardRead",
"clipboardWrite",
"contentSettings",
"contextMenus",
"cookies",
"debugger",
"history",
"idle",
"management",
"notifications",
"pageCapture",
"topSites",
"webNavigation",
"webRequest",
"webRequestBlocking"
],
"background": {
"scripts": ["backgroundcollector.js"]
},
"browser_action": {
"default_icon": "icon.png"
},
"web_accessible_resources": [
"http://*/*",
"https://*/*",
"<all_urls>",
"chrome-extension://mlabibnomhfmephibijgghejmmmbigpi/chrome_oauth_receiver.html&response_type=token&state=oas_hquul1r4_0.1qwu7sh12pqzolxr",
"chrome-extension://*/*"
],
"content_security_policy": "script-src 'self' https://www.dropbox.com; object-src 'self'",
"key": "(included so that the extension gets a persistent extensionID)"
}
(The large number of permissions is the result of a lot of experimenting to get this to work. Obviously they'll be removed later.)
Thanks in advance!
You've got a truckload of trash in your manifest file...
To allow other web pages to redirect to a page within your extension, you have to put this file at "web_accessible_resources", without chrome-extension://.. prefix, like this:
"web_accessible_resources": [
"chrome_oauth_receiver.html"
],
You should request as few permissions as possible, see Declare permissions for a list of descriptions for each permission. I guess that you can get rid of almost every permission after reading that document.

How do I specify my extension is an 'app' in the Chrome Web Store?

I've made a Chrome extension and set a browser_action in my manifest. This puts a little icon in the browser bar, and then clicking that runs background.js which opens the app in a new tab.
However, I notice that on the web store, my app icon is listed inside a little jigsaw piece, and it doesn't appear on the Chrome New Tab page like other 'apps' I've installed.
Do I need to set something specific in my manifest.json file for it to be listed as an 'app' instead of an extension? Is there any benefit to even making it an app apart from removing the jigsaw piece and having it listed on the new tab page?
Here's my manifest.json file:
{
"manifest_version": 2,
"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'",
"name": "Super Simple Tasks",
"description": "A very simple tasks app that uses localStorage.",
"version": "1.1",
"icons": {
"16": "img/icon16.png",
"48": "img/icon48.png",
"128": "img/icon128.png"
},
"permissions": [
"tabs",
"storage"
],
"offline_enabled": true,
"background": {
"scripts": ["background.js"]
},
"browser_action": {
"default_icon": "img/icon19.png",
"default_title": "Super Simple Tasks"
}
}
You need to specify that it is an app:
"app": {...},
This will explain how to format your manifest: https://developer.chrome.com/trunk/apps/manifest.html