google-chrome-app

how to convert arraybuffer to string

早过忘川 提交于 2019-12-08 05:48:42
问题 I have written a simple TCP server on node.js to send some data to a Chrome app. In the chrome app, when I get the data, I convert that to string using below function, I get an exception " byte length of Uint16Array should be a multiple of 2 " String.fromCharCode.apply(null, new Uint16Array(buffer)) I could not find any information about what could be causing this and how to fix this. Any pointers on this is highly appreciated. Below is the code in node.js server for sending the data to

Mobile-Chrome-App not able to scroll

痴心易碎 提交于 2019-12-08 05:11:12
问题 I also have this issue. I am using Ubuntu and just completed the Hello world tutorial. I wrote some more text and I am unable to scroll. I can see where the words keep going but nothing I have tried lets it scroll. I have not made any HTML/CSS edits. I have only added more text to the <p> tag. 回答1: There is some default CSS applied for chrome packaged apps. Putting the following in your CSS should re-enable scrolling: html { overflow-y:scroll; } Someone is putting together a cool guide which

Chrome App pushMessaging does not work when background page is inactive

眉间皱痕 提交于 2019-12-08 05:06:16
问题 manifest.json: { "app": { "background": { "scripts": [ "background.js" ] } }, "key": "...", "manifest_version": 2, "name": "Push Sample", "permissions": [ "notifications", "pushMessaging" ], "version": "1.0" } background.js: chrome.runtime.onInstalled.addListener( function() { chrome.pushMessaging.onMessage.addListener( function (message) { chrome.notifications.create( '', { type: 'basic', iconUrl: 'icon24.png', title: 'The Title', message: message.payload }, function (notificationID) { } );

Chrome extension: How to sendMessage form background to background?

左心房为你撑大大i 提交于 2019-12-07 23:38:33
问题 My background listener is chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) In chrome.contextMenus.onClicked listener, I want to use the message system,I call chrome.runtime.sendMessage in the listener, but it's not works. So, how can I sendMessage from background to background ? 回答1: Messages dispatched by a page are not received by the same page. If you want to be able to re-use the onMessage listener, put it in a separate function. For example: function

How to open a Chrome Packaged App with a parameter on Windows?

。_饼干妹妹 提交于 2019-12-07 19:47:24
I'm trying to create a file handler on my app, I've not Chrome OS so the only way to try my code is to launch the app from command line with a file in parameter. My question is: how? I've tried chrome --appid=[TheIdOfMyApp] --[Path of the file to open] but it just opens the app and the entry from my function is the same as when I open Mado with no parameters. To check if I have an entry I do that : chrome.app.runtime.onLaunched.addListener(function(items) { console.log(items); // The code to open the app's window... }); It always returns me Object {isKioskSession: false} . [UPDATE] My manifest

Is it possible to have a chrome packaged app that utilizes firebase?

放肆的年华 提交于 2019-12-07 15:00:49
问题 I'm running into problems with CSP. I've tried adding firebase to permissions, and sandboxing. I am trying to convert this firebase sample chrome extension(https://github.com/firebase/firebase-chrome-extension) to a chrome packaged app. The packaged app doesn't like to connect to firebase. I just keep getting security violations in the console. 回答1: I was also running to the same issue. It seems " chrome packaged app " does not allow adding "content_security_policy" and re-defining the

Replacement for fileEntry.toURL() in Chrome Packaged Apps

我是研究僧i 提交于 2019-12-07 12:07:03
问题 I'm using the HTML5 FileSystem API in a Chrome Packaged App to write to a log file. I want the user to be able to download this file, so I tried something along the lines of: fs.root.getFile('log.txt', {create: false}, function(fileEntry) { var url = fileEntry.toURL(); // do something with the file url }); This doesn't help though, because the URL is something like filesystem:chrome-extension://eekedjcagggbfigdmifkmhkjbhiklnpj/temporary/log.txt and it's not possible to open it somewhere. What

Chrome Packaged apps not working with jquery and jquery mobile

扶醉桌前 提交于 2019-12-07 10:53:36
问题 Using jQuery 1.10.2 and jQuery Mobile 1.3.2 I am trying to create a chrome packaged app with the following simple html... <!DOCTYPE html> <html> <body> <div data-role="page"> <script async src="events.js" type="text/javascript"></script> </div> </body> </html> There are two problems. The first is that jQuery will intercept the script tag loading events.js and makes the call xhr.open( s.type, s.url, s.async ); however s.async is false. Chrome packaged apps do not allow synchronous loading. So

Launching Chrome Packaged Web App from Website

谁说胖子不能爱 提交于 2019-12-07 04:35:58
问题 I have a Chrome Packaged Web app (which is required as it needs to access the Serial Port), and I'd like to be able to launch it from my website (with some data) when I click on a link/button on that website. It'd be even better if it could detect if the user wasn't running chrome or didn't have the web app installed and could direct them to the right place... Are there any examples? It seems like an obvious thing to want to do, but I'm really struggling to find anything... 回答1: To launch an

'fileSystem' is only allowed for packaged apps, and this is a legacy packaged app

♀尐吖头ヾ 提交于 2019-12-06 23:07:14
问题 I need to use the fileSystem permission in the manifest.js, so I can read/write files from my Chrome extension. When I load my extension with the "Load unpacked extension" button, Chrome displays: 'fileSystem' is only allowed for packaged apps, and this is a legacy packaged app. So for Chrome my extension is a legacy packaged app . My question is how to technically convert a " legacy packaged app " into a " packaged apps " so I can test the fileSystem API ? Here is my manifest: { "name":