google-chrome-app

Chrome extension message being passed as object

笑着哭i 提交于 2019-11-29 17:38:14
I'm sending a message from the content script to the background page. The message is a URL which then gets ajax parsed in the background. When I console.log the data retrieved into background.js the console log is pure html, but when I send the message back to my content script the message is suddenly in an object, and I'm not sure why. Here is my code: Content_Script.js: chrome.runtime.sendMessage({greeting: URL}, function(response) { console.log(response.farewell); //logs an object: Object {farewell: Object} $('#stats-table2').append(response.farewell); //doesn't output anything. });

Activate chrome app from web page?

别等时光非礼了梦想. 提交于 2019-11-29 15:41:27
I am building a packaged chrome app (It is needed as I want to access chrome.socket). I have a website from which I would like to call my app (if installed or ask the user to install it) by clicking a link. Is this possible ? Not able to find any easy way for this workflow. Sergey Shevchenko The url_handlers might be the best way to achieve this. You can also use the externally_connectable manifest property to declare that your website can connect to your app, then call chrome.runtime.sendMessage or chrome.runtime.connect from your webpage and handle it in an chrome.runtime.onMessage handler

unlimited file storage in chrome app

隐身守侯 提交于 2019-11-29 15:16:05
问题 I want to save an unlimited number of files to the users hard drive, without making the user click through a dialog box. The only documentation I have seen on using unlimited storage is here: https://developers.google.com/chrome/whitepapers/storage, which says that it is only available to Chrome apps. All of the examples I have seen of the Chrome fileSystem API suggest that in order to create a new file and write to it, the user needs to obtain an entry object from the chrome.fileSystem

How to open a new window from a link in a webview in a chrome-packaged app

南笙酒味 提交于 2019-11-29 14:41:01
问题 In order to show ads from a banner exchange, I'm loading a webview containing an iframe linking to the ads server. Through some javascript I can have the ad link target to be "_blank" so the ad would open in a separate browser window, otherwise it would open in the same small webview. However it doesn't work and I get this in the console: <webview>: A new window was blocked. Any ideas how to do this? 回答1: The thing is that by default a webview will not let the guest open arbitrary windows.

Error using Firebase from Chrome App

北城余情 提交于 2019-11-29 14:23:43
I am attempting to use Firebase from within a Chrome App (not an extension) and have not been able to work around the following error: Refused to load the script 'https://{my firebase id}.firebaseio.com/.lp?start=t&ser=81980096&cb=15&v=5' 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 a fallback. my manifest.json file looks like this: { "manifest_version": 2, "name": "Simple Demo", "version": "1", "icons": { "128": "icon_128.png" }, "permissions": [

Chrome extension in app purchase always returns PURCHASE_CANCELED, even if the purchase worked

时间秒杀一切 提交于 2019-11-29 14:17:52
This question is related to the one at Chrome Webstore Extension In App Purchase INTERNAL_SERVER_ERROR . I first posted my question there in the form of a comment, but received feedback that this was more appropriate as a separate question. Like the OP, I am using buy.js and following the recommended workflow for in-app purchases in the Chrome extension. But my results are somewhat different: when I complete the IAP buy dialog, I get back a PURCHASE_CANCELED, even though I bought the IAP. If I then list the purchases SKUs through the api, it shows up as having been purchased and active. I also

Chrome Apps : How to save blob content to fileSystem in the background?

只谈情不闲聊 提交于 2019-11-29 10:57:53
In Chrome Apps, I'm downloading a blob content from a server using JavaScript XHR (Angular $http GET in particular, with response type 'blob') How should I save this to chrome application's file system? Currently using an Angular wrapper on HTML5 filesystem API https://github.com/maciel310/angular-filesystem I do not want to show user a popup (hence I can't use chrome.fileSystem. chooseEntry ) The chrome.fileSystem.requestFileSystem API is only supported by Kiosk-only apps. Hence I'm using HTML5 FileSystem API instead of chrome's. I'm using following code to make XHR to fetch blob. $http({ url

How to allow video autoplay in a Google Chrome kiosk app in version 66 or later

余生颓废 提交于 2019-11-29 09:32:27
As of version 66 of Google Chrome onwards it will no longer automatically start playback of audio and video files when the playback volume is not muted. This change was made to prevent autoplay on ad videos and other annoying web page elements. However, this has negative consequences for a number of perfectly valid applications of the autoplay feature, for instance in signage applications. The new default behaviour of not auto playing a video with sound can be overridden at the startup of the Google Chrome browser with the command line options --autoplay-policy=no-user-gesture-required or --no

How to inspect contents of storage.local in Chrome Packaged App?

时光总嘲笑我的痴心妄想 提交于 2019-11-29 09:23:31
问题 Is there some way (extension, or special debug option) to inspect contents of storage in Chrome Packaged App, other than using javascript console? Resources tab only allows inspection of localStorage/sessionStorage (which is disabled in packaged apps) 回答1: After I've realised that there is really no other option but JS console, I've created devtools extension (took 4 hours to create initial version), which can inspect chrome.storage. So now there is such tool=) Sources 回答2: Try just typing:

How can I launch a Chrome Packaged App through javascript?

不问归期 提交于 2019-11-29 08:30:19
I want to be able to launch my packaged chrome app via javascript either on-page or through an extension. Am I able to do this? I have done a fair amount of research with no answer in either direction. Can somebody at least point me in the right direction? chrome.management.launchApp can be used to launch an app in an extension. The API reference is available here: https://developer.chrome.com/extensions/management.html#method-launchApp . You can make certain resources in your extension available, and then you should be able to "window.location" to that. The URL scheme is chrome-extension://