google-chrome-app

Persist data across single app kiosk mode executions

断了今生、忘了曾经 提交于 2019-12-13 16:04:59
问题 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 executions of the app. I wrote a test app illustrating this issue. Code here. 回答1: note: this answer applies only to users of the Chrome Management Console It turns out the issue had everything to do

How to use USB API with any USB device?

我们两清 提交于 2019-12-13 06:49:11
问题 I've created an app that uses the USB API to open a new tab when the USB device is connected. But now I want to improve it a bit. Before, when I use USB API I must define its vendorID and productID in the manifest. It means my app only use exactly one USB device. Now I want any USB to interact with my app. Anybody can give me an idea to do it? 回答1: I do believe it's impossible for security reasons. You can specify more than one PID/VID pair, but you cannot ask for arbitrary ones. The stated

toDATAURL JPEG not working properly in chrome packaged app

不打扰是莪最后的温柔 提交于 2019-12-13 04:55:16
问题 When I try a: canvas.toDataURL('image/jpeg'); in a chrome packaged app the result is a png data url not a jpeg url. Also, I cannot put in a quality either ie. canvas.toDataURL("image/jpeg",0.7); An exception throws saying the method does not exist, if and only if I add the quality metric. Am I doing something wrong? 来源: https://stackoverflow.com/questions/16127441/todataurl-jpeg-not-working-properly-in-chrome-packaged-app

Diagnosing chrome.usb.claimInterface() error

隐身守侯 提交于 2019-12-13 04:45:48
问题 I'm using chrome.usb API from a Chrome app to interact with a USB device, a smart card reader. I can open the device and pull the configuration. Yet when I call claimInterface() to start exchanging data, I get an error with message: "Error claiming interface." and no other diagnostics. Any pointers how to deal with that, please? Can I somehow enable diagnostic logging from the API, for example? 回答1: in this thread is discussed a similar problem: Error message 'Interface not claimed' from

How to Launch a PDF from a Chrome Packaged App?

牧云@^-^@ 提交于 2019-12-13 04:43:24
问题 My chrome packaged app contains a PDF, and I would like to let the user view it. If I open it in the current frame I get the error "Chrome PDF Viewer is not Allowed". Frankly, the chrome PDF viewer is pretty awful, so I'd rather let the user view it in their PDF viewer of choice anyway. If I disable the chrome PDF plugin (just as an experiment) and I try to open the PDF using chrome.app.window.open, it "downloads" the PDF, and then the user could open it. But this has two issues: I can't

Chrome App: How to enumerate files under a static folder?

喜你入骨 提交于 2019-12-13 03:44:24
问题 How can I enumerate files under a static folder (such as images where all the static images used by my app are stored) while developing a chrome app? What I have tried: - looked at these links 1, 2. i am not trying to read from local or user storage. i want to read from static storage. static storage are the folders where an app stores its static contents - assets like images, css, js etc. - looked at this link. but my app needs to be able to enumerate all files under a static folder without

Chrome extension + webview

♀尐吖头ヾ 提交于 2019-12-13 03:24:56
问题 I'm struggling to find a definitive answer to this. Chrome Apps are being deprecated across all OS except Chrome OS. <webview> is only available in Chrome Apps? This means I can't or shouldn't use <webview> in an extension (if possible)? 回答1: As per further research, testing, and comments: <webview> are definitely not useable in extensions, only in Apps. 来源: https://stackoverflow.com/questions/47274744/chrome-extension-webview

Register gcm for chrome

江枫思渺然 提交于 2019-12-13 03:03:29
问题 I have a chrome Apps use push notification of GCM. I have a problem, when i don't login account on chrome. I can't receive registerId from GCM. I think a idea. When registerId empty, i show notification, request user login to chrome and show login page account on chrome. But because of security concerns , the chrome does not allow access to its setting from external links . How is open "chrome://settings/" from external links? Can register to gcm, If i don't want login account on chrome? My

Save a file to filesystem with chrome packaged app

拥有回忆 提交于 2019-12-13 01:53:37
问题 I have a variable full of css attributes that I would like to use to create a CSS file and save it to the apps file directory. How would I go about this in a chrome packaged app? 回答1: You're not going to like this answer. You can't do this, and if you figured out a way to do it, it would be considered a security hole that the Chrome team would close. Part of the design goals of packaged apps is to make the entire application statically analyzable at the time it's uploaded to the web store.

Where to register the Native Messaging Host in Chrome OS

二次信任 提交于 2019-12-13 01:00:00
问题 In this documentation there's the location for Windows, Mac OS and Linux. I assumed Chrome OS would work the same as "standard" linux, but i couldnt get my app working ... com.my_app.host.json (located in /etc/opt/chrome/native-messaging-hosts/) { "name": "com.my_app.host", "description": "My Host", "path": "/home/user/bfd93db2180e0d7645b1f4cce2d2c7ed9e0d835c/Downloads/host.sh", "type": "stdio", "allowed_origins": [ "chrome-extension://APP_ID/" ] } main.js var port = null; var getKeys =