google-chrome-app

How to overwrite a file in Chrome App?

微笑、不失礼 提交于 2019-12-10 13:43:42
问题 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

javascript not working in chrome-app

人盡茶涼 提交于 2019-12-10 13:23:58
问题 I'm trying to get started writing chrome apps. For some reason when I view as a chrome app the javascript does not work but it works fine as a webpage. Here's the simplest instance of my issue. opening index.html with chrome works as expected--the "hello world" string becomes "CLICK" when the button is pressed. Running as a chrome app nothing happens when the button is pressed. manifest.json: { "manifest_version": 2, "name": "My first app", "version": "0.0.1", "app": { "background": {

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

天涯浪子 提交于 2019-12-10 13:09:50
问题 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 wrong? Also I tried switching /spotify with /provider_cb . var client_id = '<my_client_id>'; var redirectUri = chrome.identity.getRedirectURL() + "/spotify"; chrome.identity.launchWebAuthFlow({ "url": "https://accounts.spotify.com/authorize?client_id="+client

Why I get an undefined object when I use chrome.bluetooth.getAdapterState?

耗尽温柔 提交于 2019-12-10 11:32:55
问题 I'm using Google Chrome 33.0.1729.3 dev on Linux (elementary os 0.2 based on Ubuntu 12.04) I create a Chrome App and configured the manifest.json to grant bluetooth permissions: { "name": "App Name", "description": "App Desc", "version": "0.1.0", "app": { "background": { "scripts": ["background.js"] } }, "permissions": ["bluetooth"], "icons": { "16": "app-icon-16.png", "128": "app-icon-128.png" } } when I trigger this script on the app chrome.bluetooth.getAdapterState( function( result ) {

one more time about: Error: Attempting to use a disconnected port object, how to?

帅比萌擦擦* 提交于 2019-12-10 10:49:16
问题 here is my setup background.js var port = null; function setPort() { chrome.tabs.query({active: true, currentWindow: true}, function (tabs) { port = chrome.tabs.connect(tabs[0].id, {name: "CONTENTSCRIPT"}); }); } // when i click on something, get the port and send a message function clickHandler(e) { setPort(); if (port) { port.postMessage({key: 'message', value: true}); } } contentscript.js chrome.runtime.onConnect.addListener(function (port) { if (port.name == "CONTENTSCRIPT") { port

How to include a data file in a chrome app for a native client module to read

三世轮回 提交于 2019-12-10 10:48:52
问题 If I have a chrome packaged app that also includes a PNaCl/NaCl module, is there a way to include in the packaged app some data files, which the NaCl module will then read in? I don't need to do any file writing, just to include some data files that the native module needs to make use of. 回答1: The entire contents of your packaged app are available to both JavaScript and NaCl code via http requests. If you use the nacl_io library then you can also access all the files using standard POSIX file

Chrome Packaged App with SQLite?

眉间皱痕 提交于 2019-12-10 10:37:00
问题 I was trying to integrate sql.js (JS based SQLite https://github.com/kripken/sql.js/) into my chrome app but as I launch my app, console shows the following errors: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in 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 a fallback. Uncaught EvalError: Refused to evaluate a

Notification at DART lang - Chrome Packaged App

元气小坏坏 提交于 2019-12-10 10:35:35
问题 I want to use notification in Chrome Packaged app, built by DART. my pubspec.yaml is: dependencies: browser: any chrome: any transformers: - chrome my main.dart is: import 'dart:html'; import 'package:chrome/chrome_app.dart' as chrome; void main() { .... NotificationOptions notOptions = { 'message': 'this is a notification message' }; chrome.notifications.create('id1', notOptions).then((id) => print('notification created')); .... } it gave me a problem: "Undefined class 'NotificationOptions'"

Testing Chrome In App Payments

那年仲夏 提交于 2019-12-10 10:09:49
问题 I am looking to integerate IAP (https://developer.chrome.com/webstore/payments-iap) in to my extenstion but I can't seem to find a way to test payments. If I switch the env to sandbox I get and error of type "ENV_NOT_SUPPORTED_ERROR" 回答1: Quoting the docs you link: Testing purchases Prior to publishing your app to the world, you can test the In-App Payment experience by publishing it only to trusted testers. When your app is published to trusted testers, the purchase flow will proceed

Chrome packaged apps local root html links via Sandbox Manifest 2

依然范特西╮ 提交于 2019-12-10 09:58:12
问题 I'm getting a red error when I click on any local url inside the app it says. Can't open same-window link to "chrome-extension://nmajpganl/options.html"; try target="_blank". index.html:1 Is there a way to link locally with permissions? Or do I have to rewrite everything to be on one page? I think this is related to the Chrome Manifest Sandbox .. needing to include all the pages you will link to? Can anyone confirm this? 回答1: Packaged apps aren't websites. A principal difference between apps