FAQ Database Discussion Community


Definition of Chrome App/Extension/Legacy

google-chrome,google-chrome-extension,google-chrome-app
From what I understand each Chrome App/Extension/Legacy is defined by attributes in its manifest.json, those attributes being the following: Chrome App: A Chrome App will have the following in its mainfest.json: "app": { "background": { "scripts": ["background.js"] } } background.js calls the chrome code chrome.app.window.create which will open a new...

Google Cloud Messaging in dart

dart,google-chrome-app,chromium,chrome-gcm
I'm trying to connect to the Google Cloud Messaging with this code in dart senderIds.add("api-project-testid"); chrome.gcm.register(senderIds).then(registerCallback); but I have this error: Exception: Uncaught Error: Profile was not signed in. I think that the error arises from the fact that chromium is not connected with any account. Does anyone know how...

window.alert() is not available in packaged apps

javascript,google-chrome-app
I am making a Chrome application. I keep getting the error in console: window.alert() is not available in packaged apps. extensions::platformApp:17 Line 17 of that file is just a line of code to log the error to the console. Is there a way to alert the user of an event...

Request with google chrome api

google-chrome,google-chrome-extension,google-chrome-app
I'm developing an extension for google chrome, where I hear the commands CTRL + SHIFT + 1 and CTRL + SHIFT + 2 and I store the text of the mouse selection. When the user hits CTRL + SHIFT + 3 or CTRL + SHIFT + 4 I would like...

Chrome app content security policy issue

google-chrome,youtube,google-chrome-app
I'm trying to build a chrome app that embeds Youtube content but facing this error while using some scripts : "Refused to load the script 'https://www.youtube.com/iframe_api' because it violates the following Content Security Policy directive: "default-src 'self' chrome-extension-resource:". Note that 'script-src' was not explicitly set, so 'default-src' is used as...

Is HTML5 drag and drop compatible with Chrome Apps (packaged)?

html5,google-chrome,google-chrome-devtools,google-chrome-app
I've tried the traditional methods and it works as a webpage in Chrome, but not when I'm using the page as a packaged app. I'm just doing this example from W3 for testing purposes since it's very simple. http://www.w3schools.com/html/html5_draganddrop.asp...

Intercept dialog from and read the contents

webview,dialog,dart,google-chrome-app
I use this code to intercept a dialog from a webview but I can not see the content or interact with it: Element webview= querySelector("#webview"); Map<String,String> map=new Map(); map["src"]=urlWebView+user; webview.attributes.addAll(map); querySelector("#webview_cont").style.visibility="visible"; window.addEventListener("dialog",(Event e){ //Use window or webview returns the same result e.preventDefault(); ... //What should I do here ?? }...

Optional permission for filesystem

google-chrome,google-chrome-extension,google-chrome-app
Is it possible to mention filesystem as an optional permission requested by chrome.permissions.request API (for Chrome apps)? My JS code includes : document.getElementById('savebtn').addEventListener('click', function () { chrome.permissions.request({ permissions: ["fileSystem"] }, function (granted) { if (granted) { chrome.fileSystem.chooseEntry({ type: 'openDirectory' }, function (entry) { ... }); } }); }); but I...

Alert dialog from was blocked

javascript,webview,dart,google-chrome-app
Dart doesn't show the alert dialog when I use a webview and show this error: : An alert dialog was blocked. (extensions::webViewEvents:225) : A confirm dialog was blocked. (extensions::webViewEvents:225) Does anyone know how to bypass the problem or how to catch the error? Thanks. Sorry for my bad English. Edit...

Display the contents of folders dynamically with chrome.fileSystem

html5,filesystems,google-chrome-app
Is this possible with chrome.filesystem that clicking on the name of a folder displayed above list form, it dynamically displays the files in that folder. example: Here are my issues: folder 1 folder 2 folder 3 If I click on the folder 2, chrome displays me the files contained in...

Persist data across single app kiosk mode executions

google-chrome-app,kiosk-mode
When developing normal Chrome Apps, I use the Chrome storage API to persist key-value pairs across sessions. This works great, and I want to do the same for a Single App Kiosk Mode app to be deployed on managed Chrome devices. However, it seems that chrome.storage.local does not persist across...

Suppress “Failed to load resource: net::ERR_FILE_NOT_FOUND” in Chrome Packaged App

google-chrome,webview,google-chrome-app,console.log
I get the message "Failed to load resource: net::ERR_FILE_NOT_FOUND" in the console when a webview in a Chrome Packaged App tries to load a non-existent local file. This is expected, because the program is supposed to check a couple of different location, starting with the local system and then switching...

Is it possible to package a Chrome app as an independent native app? [duplicate]

google-chrome-app
This question already has an answer here: Standalone chrome applications 2 answers In other words, is it possible to create a Google Chrome app and package it as an .exe or .app so that users won't need Chrome to be installed to run it? I'm working with NWJS at...

Chrome Packaged App - Use AngularJS in background/event page

javascript,angularjs,google-chrome,google-chrome-app
As we create a chrome app, we put scripts on the background property in the manifest.json file (this will serve as the app's background/event page). What I want is, I want to use AngularJS on background script but I dont know how. And also, is it possible? I just saw...

What is “platforms” for in manifest.json?

google-chrome-extension,google-chrome-app
In manifest.json definition, there is a "platforms" key. However, I cannot find it documented anywhere. What does it do?...

Catching “Failed to load resources” errors caused by HTML tags in a

javascript,html,webview,error-handling,google-chrome-app
I am loading web pages in Chrome App webviews. I sometimes get "Failed to load resource" messages in the console for some of the <script> and <img> tags. I want to catch these errors so I can act on them in JavaScript code, rather than have messages appear in the...

How Do Chrome Apps/Extensions View Search/Browsing History if there is no permission for it?

javascript,google-chrome-extension,google-chrome-app
There are several apps/extensions that work with search/browsing history, here are just two: 1) https://chrome.google.com/webstore/detail/better-history/obciceimmggglbmelaidpjlmodcebijb?hl=en 2) https://chrome.google.com/webstore/detail/history-timeline/gjhpcfomcckgcaniehfgakaddjgncpeb?hl=en However, unless I'm missing something neither apps nor extensions have a permission for retrieving the full search or browsing history, only for deleting it, querying for a specific website, or adding urls to...

Open a website in new tab when clicking on Chrome App icon

google-chrome-extension,google-chrome-app
I am developing a Chrome App/Extension. Technically, it's a Chrome App, since only apps have access to Chrome USB API, and I need that. However, in reality, it works more like a Chrome Extension, since I allow specific websites to send messages through message passing, and the app has no...

Refuse to load JS in Dart

javascript,dart,google-chrome-app,content-security-policy
In my web page for Dart amount this script: <script src="https://test.net/test/test.js"></script> but when you launch the application it gives me the following error: Refused to load the script 'https://test.net/test/test.js' because it violates the following Content Security Policy directive: "default-src 'self' chrome-extension-resource:". Note that 'script-src' was not explicitly set, so 'default-src'...

Chrome app in web store works fine for me, but nobody else. Possible key error?

google-chrome-extension,google-chrome-app
I created a chrome app which uses the identity api, and it is deployed on the chrome web store. I cleared the dev version from my computer and downloaded it myself and it works wonderfully. All it really does is get your identity, use that to grab a token that...

Use the chrome.idle API to restart application

google-chrome,google-chrome-app,idle-timer,chrome-app-developer-tool
I have a Chrome kiosk app that basically just uses webview to allow someone to browse through a catalog. I found the chrome.idle API, and believe I understand how to set idle time and query if the device is idle, but can I have it restart the application when the...

How to start Chrome Hosted App in window?

google-chrome,google-chrome-app,hosted
So i know that 'Chrome Packaged App' will run in a window , I have tried to run the website i want in a <webiview> tag but it gets stuck at the beginning and I can't find a way to debug what's happenning inside that <webview> tag. I now have...

“Refused to load the image” in a Chrome App

dart,google-chrome-app,content-security-policy
I have this problem in dart Refused to load the image 'https://**.png' because it violates the following Content Security Policy directive: "img-src 'self' data: chrome-extension-resource:". when try to set src in image element ImageButtonInputElement button = new ImageButtonInputElement(); button.className="button_element"; button.src=el["imageUrl"]; //like "https://**.png" whit this manifest.json "content_security_policy":"img-src https://server.example.org" Someone would know...

Native Client Packaged App and MIME type

google-chrome-extension,google-chrome-app,google-nativeclient
Using a NaCl packaged app, is it possible to handle a MIME type for a dummy resource within a webpage (the type and location of resource does not matter e.g from the app pkg)? I need it to just launch the already installed packaged app without user's mouse click. Thank...

Files written from chrome packaged apps are all empty

javascript,google-chrome,google-chrome-app
The Problem I am trying output a file from a Chrome Packaged app (using chrome.fileSystem) that I am developing, but all the files are being saved are being created, but with no content no matter what I do. I have researched this for hours and can only seem to find...

Load a binary asset file into Chrome App

javascript,google-chrome-app
I'm trying to make a Chrome app that will have some animated objects in it. I can load textures by using: new Image() and then setting the image's src property to the name of a file in my app's root directory. (This will load the texture) Is it possible to...

Can I build/install extensions for Chrome OS (i.e. not for Chrome browser)?

google-chrome,google-chrome-app,google-chrome-os
The on-line docs imply that extensions are only applicable to the Chrome browser. However, some APIs could be used to extend the Chrome OS. For example, fileBrowserHandler can be used to extend the Chrome OS file browser. If this is true then how would I build/install an extension for the...

Broadcast message (ping) cross chrome extensions

javascript,google-chrome,google-chrome-extension,google-chrome-app
I am trying to figure out a way which allows my extension to send a ping to all extensions installed within the browser. The idea is the following, I have 3 separated extensions. One behave as the middleware, and tries to send a broadcast message to all other exciting extensions...

Mobile App Performance : Polymer or Ionic?

javascript,cordova,ionic-framework,polymer,google-chrome-app
I am a web developer and I heard that Google just released the "production ready" version of Polymer (1.0). On the other hand, I have heard a lot about Ionic since 2013. I am now trying to find the best way to make a web app look native, responsive and...

Chrome APIs without calling chrome.app.window.create()

google-chrome-app
Is it possible to use chrome APIs (specially chrome.sockets) inside its background script without calling chrome.app.window.create()? Thanks...

Why chrome.sockets.tcp.create() does not work in app background script?

javascript,sockets,google-chrome,google-chrome-app
I am trying to create a tcp socket in the background script of my app. The error is (first line in 1.js): Uncaught TypeError: Cannot read property 'tcp' of undefined Background script 1.js: chrome.sockets.tcp.create({}, function(createInfo) { chrome.sockets.tcp.connect(createInfo.socketId, "127.0.0.1", 4005, function(socketInfo) { }); }); Manifest file : { "manifest_version": 2, "name":...

Android Cookies (Reward for Invites)

android,cookies,google-chrome-app,android-browser
I am trying to integrate 'reward for invites' logic. What I am trying to do for this is I generate a unique URl for every user. When a friend clicks on the URL he is directed to a page and then to the playstore. On the page, a cookie with...

error “Cannot return to provided redirect_uri” in chrome extension using stackapp auth 2.0

google-chrome,google-chrome-extension,google-chrome-app
I follow the tutorial here https://developer.chrome.com/apps/app_identity and use the api here https://developer.chrome.com/apps/identity but with no luck. Could anyone point out is anything wrong in this code? function onGoogleLibraryLoaded() { var redirect_uri = chrome.identity.getRedirectURL("http://qqibrow.github.io"); var full_url = "https://stackexchange.com/oauth/dialog?client_id=4716&redirect_uri=" + redirect_uri; console.log(redirect_uri); console.log(full_url); chrome.identity.launchWebAuthFlow({ 'url': full_url,...

Chome extension message between users

node.js,google-chrome-extension,google-chrome-app,p2p,chrome-gcm
Is it possible to send messages between users directly without a server in chrome extensions? (P2P) Or required server (NodeJS example)? Maybe use Google Cloud Messaging, i not understand logic and work (official example extension)...

Angular2 example in ChromeApp using ChromeDevEngine missing require?

angularjs,google-chrome-app,angular2
I am trying to get the angular2 demo code to run in Chrome Dev Engine. I followed the example exactly and get the following error. Uncaught ReferenceError: require is not defined main.js:4 Uncaught TypeError: Cannot read property 'Component' of undefined However when I put the exact same code anywhere else...

Getting a Chrome app window to open at the bottom right of screen

javascript,google-chrome,google-chrome-app
I would like my Chrome app to open so it's touching the task bar and just offset from the right of the screen. My current code: chrome.app.runtime.onLaunched.addListener(function() { chrome.app.window.create('window.html', { 'bounds': { 'width': 300, 'height': 325 }, 'resizable': false, frame: 'none' }); }); ...

How to overwrite a file in Chrome App?

javascript,google-chrome,filesystems,google-chrome-app,filewriter
I followed this example: chrome.fileSystem.chooseEntry({type:'openDirectory'}, function(entry) { chrome.fileSystem.getWritableEntry(entry, function(entry) { entry.getFile('file1.txt', {create:true}, function(entry) { entry.createWriter(function(writer) { writer.write(new Blob(['Lorem'], {type: 'text/plain'})); }); }); entry.getFile('file2.txt', {create:true}, function(entry) { entry.createWriter(function(writer) { writer.write(new Blob(['Ipsum'], {type: 'text/plain'})); }); }); }); }); to overwrite some existing file file1.txt and...

Highcharts won't display in Chrome App

javascript,jquery,google-chrome-extension,highcharts,google-chrome-app
I am trying to embed a chart from highcharts.com (using jquery). The graphs works fine if I just open windows.html in chrome itself, but it will not load in my chrome app. Just a blank screen. I have all the standard .js files in the folder, but didn't include them...

How to read version of app in app?

javascript,google-chrome-app
I want to read the app version stored in manifest.json: ... "version": "0.1.0", ... during the execution of the app (really just after loading) to display the app version. I also do NOT want to have the version in multiple places because it can get out of sync. Is there...

Set bounds on a window that has an id

google-chrome-app
My app has a settings window, I want this window to be unique so that a user cannot display two settings windows at the same time. The problem is that I also want the window to be centered compared to the main window. I use this code (in the JS...

How to secure data on a Chrome Packaged app?

javascript,google-chrome,google-chrome-app
I am building a Chrome App for my company's customers. These customers act as service providers (call them service providers) and have their own users (call them end-users) who share critical data with the customers. The app that I am building will be used by employees of my customers (call...

How to start a background task when chrome fires up for a chrome app?

google-chrome,google-chrome-extension,google-chrome-app
I am creating a chrome app (packaged) and I have to create a socket and listen for the incoming broadcast messages as soon as chrome browser starts up. I came across this API , but it seems to be only for extensions. And also the API for listening when a...

chrome.tabs.highlight giving error “No tab at index”

google-chrome-extension,google-chrome-app
When calling chrome.tabs.highlight({'tabs': tabId}, function(){}); I'm getting this error: Unchecked runtime.lastError while running tabs.highlight: No tab at index: 7355....

How to structure a multi-page chrome app?

javascript,google-chrome-app
I'm building a file for each 'page' I want to dynamically load. Each 'page' file is implemented using the Singleton Pattern, with pretty much just one public method, loadPage() or init(). Is there a better way to approach this? A framework that I should know of? It's not a complicated...

Not getting onReceive callback for UDP socket on chrome after event page is unloaded

javascript,sockets,google-chrome,udp,google-chrome-app
I am creating a chrome app (packaged) and I have to create a UDP socket and listen for the incoming broadcast messages as soon as chrome browser starts up. Everything works fine as I start browser , I get the callback registered through chrome.sockets.udp.onReceive.addListener() API and the data as well....

Front-end JavaScript program [closed]

javascript,frontend,google-chrome-app,web-frontend
I am relatively new to web development. If you are creating a front-end JS application, is it always the case that a page refresh incurs a new JavaScript program? Is it possible to keep the same JavaScript runtime going during a page reload? I know there are many solutions to...

Chrome App FileReader

google-chrome-app,filereader
I'm trying to make use of the file system API in a Chrome App. I've tried all the sample code I can find and can't get a simple text file to read. I'm logging almost every step, and what seems to happen (or not happen) is everything stops the first...

How do you make a Chrome App automatically launch in a maximized window?

json,google-chrome-app
I am making a chrome application and I am wondering how I would make the program automatically run in a maximized window. The manifest.json defaulted to 800x600 but I want it to fill whatever the largest dimensions are. I saw on one of Google's developer pages that you can use...

How would I open my Chrome app in split screen rather than a new window?

google-chrome,google-chrome-extension,google-chrome-app
I'm doing a little research on how to develop a Chrome app for a project I have in mind. I would like to open my app in a split screen inside a person's browser tab, so that they can still see the webpage in the browser while interacting with my...

Unchecked runtime.lastError when using Chrome API

javascript,google-chrome-extension,google-chrome-app
I use chrome.fileSystem API in my app to open a file. When I click the Cancel button of the file chooser dialog, an error occurs: Unchecked runtime.lastError while running fileSystem.chooseEntry: User cancelled How to fix this error?...

Factory not passing $http.get based object array to controller in angular.js

javascript,angularjs,angularjs-directive,google-chrome-app
I am just starting out in Angular, and I have been stuck for some time on an issue. My factory is properly creating an array containing objects, RSS feed data, and will load to the console. The issue is that I cannot seem to get the array to return to...

chrome.bluetooth.getDevices is not discovering a BLE device

javascript,osx,bluetooth,google-chrome-app
Running the heart-rate-sensor example, I am unable to detect a BLE device (known-good heart-rate sensor evaluation kit) in the resulting callback after a chrome.bluetooth.getDevices call. Even If I attempt to periodically re-call getDevices every 5s: setInterval(chrome.bluetooth.getDevices, 5000, onDeviceSearchCompleted); and toy with the power on the ble device, I only see...

Add things to the application menu in a Chrome app

menu,google-chrome-app
Is it possible to add items to the application window (as opposed to the context menu) in a Chrome app? (Or, for that matter, alter it in any way?)

chrome.filesystem save file without prompt location

html5,google-chrome,google-chrome-extension,google-chrome-app,html5-filesystem
can i save file in custom location (/home/Users/user1/) with name file1.txt. I have this code: chrome.fileSystem.chooseEntry({type:'openDirectory'}, function(entry) { chrome.fileSystem.getWritableEntry(entry, function(entry) { entry.getFile('file1.txt', {create:true}, function(entry) { entry.createWriter(function(writer) { writer.write(new Blob(['Lorem'], {type: 'text/plain'})); }); }); }); }); With this code, i get prompt so i need to choose directory, but i want...

Chrome Web App webview height issue

google-chrome,google-chrome-extension,google-chrome-app
I'm new in Chrome Web App programming. I want a simple WebApp which is separated to my Chrome/Chromium (means no tab). It shall show a external website in the body. So here is my configuration: manifest.json { "name": "Hello World!", "description": "My first Chrome App.", "version": "0.1", "manifest_version": 2, "permissions":...

svg reference external javascript function [duplicate]

javascript,svg,external,google-chrome-app
This question already has an answer here: onClick within Chrome Extension not working 2 answers I want to have an svg embedded in an html doc reference an external javascript function. I have an html document with an embedded svg file and a link to a js file. I...

PouchDB for Chrome Apps

javascript,html,google-chrome-app,indexeddb,pouchdb
I'm making a Chrome App and using PouchDB(all my first time). Got the IndexedDB running on the Resources panel of the DevTools. The problem is the adding and updating of data to PouchDB. It's not working. Here's the code: (app_jr.js) var saveregister, JrRegisterObj, pn; JrRegisterObj = function (databasename, remoteorigin){ 'use...

chrome.local.storage save directory info and retrieve this information

html5,google-chrome,google-chrome-app,filereader
Is it possible to save information from a directory with chrome.local.storage and subsequently retrieve this information to display the files contained inside. Thank you in advance!...

how could I make a textarea dynamically resize with the chrome app window?

javascript,css,google-chrome-app
I have been trying to make a chrome app that is completely filled by a textarea and I would like to make that textarea dynamically resize with the app window. I do not how ever want to use any external library for example jquery. My html is: <!DOCTYPE html> <html>...

Chrome UDP sockets not receiving from remote machine

javascript,sockets,google-chrome,udp,google-chrome-app
I'm working on a Google Chrome app that contains the following code: var socket = chrome.sockets.udp; var PORT = 5005; var HOST = '127.0.0.1'; socket.create({}, function(sockInfo){ socket.bind(sockInfo.socketId, HOST, PORT, function(result){ socket.onReceive.addListener(function(info){ // do stuff with the packet data }); }); }); This mechanism worked perfectly when I was sending data...

Chrome Serial API has strange intermittent behavior

javascript,serial-port,google-chrome-app
I am developing a packaged chrome app that communicates with a serial device. To make a long story short, here are the facts: I can open a connection successfully with the serial port when a page loads I can execute a particular command that takes about 20-60 seconds to return...

Is there a way to launch chrome packaged app from chrome extension

google-chrome,google-chrome-extension,google-chrome-app
I'm developing a chrome packaged app and chrome extension, both of them communicate with one another, and i want to lunch my packaged app from a chrome extension, is there any way to do it? Note: I've tried using the launchApp method of chrome management api, but for some unknown...

launchWebAuthFlow with Spotify returns “Authorization page could not be loaded”

google-chrome,google-chrome-extension,spotify,google-chrome-app,spotify-app
I registered my app on Spotify. I made sure I had the URI added to my registered app. But still every time I run this code I keep getting the same error. I am also running this in the background so I know it's not that. What am I doing...

Library uses localStorage - Chrome Web Store

javascript,html5,google-chrome,local-storage,google-chrome-app
So yes Chrome has its own local storage API. I used chrome.storage.local.set({"item": itemValue}); and chrome.storage.local.get("item", function (result) { console.log(result); }); For all my storage calls. The problem I face is I have developed a HTML5 game with Phaser.js and it includes localStorage statement somewhere inside of it, which doesn't allow...

How to change the name of a listing on the Chrome Web Store

google-chrome-app,chrome-web-store
I just published an item on the Chrome Web Store and at the time I could not change the name. Is there a way I can do this? Is it in the ZIP file I uploaded? Thanks.

Do Chrome Apps have the same permissions available to them as Extensions?

google-chrome-extension,google-chrome-app
This page:https://developer.chrome.com/extensions/browsingData softly suggests no with the wording of things like: You must declare the "browsingData" permission in the extension manifest to use this API. presumably there is a difference between the app and extension manifest?...

Is it possible to get the content of a file by path directly, in chrome application?

file,google-chrome-app
I'm writing some chrome application, and want to read some local files. I didn't found any api from chrome that allowed to read a local file by path directly, but only a chooseEntry which would open a dialog to let user choose the directory first. Is there any api of...

How to open link from packaged`s app web-view into default browser?

google-chrome,google-chrome-app
There is a messenger chrome packaged app with webView inside. How I can open links from messenger in browser? Project is open source: https://github.com/clicman/OdSkype...

Read Folder Contents in Chrome Application

javascript,google-chrome,google-chrome-app
I have an application which outputs text files periodically with data in it. The text files are initiated from within the application and a datetime/context sensitive name -- though always output to the same folder. I would like to write a chrome application that can watch the folder these files...