google-chrome-app

How is use of npm to install global packages that don't even get used in Node applications justified?

我只是一个虾纸丫 提交于 2019-11-30 17:13:13
问题 My knowledge of npm is this: It is a package manager for Node.js applications. What this means is that when you need someone else's library/package for your node application you can conveniently use npm to get those dependencies. But I recently came across this command: npm install -g cca . Then I enter cca in my terminal and now it starts some program. Now my question is how can npm install packages that can be accessed via the terminal? I mean all packages installed by npm should be

With Chrome FileSystem, let the user choose a Directory, load files inside. And save files in that directory without prompting again

二次信任 提交于 2019-11-30 15:22:33
I could not found any examples with this scenario so here we go: I want the user choose a directory, load all files inside it, change them, and save this file overriding it or saving a new file in that same directory without asking where he want to save. I don't know how to list the files of the directory I don't know how to save a file in a directory without prompting the filechooser window I believe it is possible because I see something similar here (last paragraph): http://www.developer.com/lang/using-the-file-api-outside-the-sandbox-in-chrome-packaged-apps.html Any answer will be

Load local file in Chrome App Webview

旧街凉风 提交于 2019-11-30 15:18:33
问题 In Chrome packaged apps you can use to load external pages inside the app. Is there a way to make them load a local file (an html file inside the packaged app)? I can't use iframe, because iframe wont support external resources (scripts, images, whatever). 回答1: Don't have any code to show, but try this: Assuming you can read the local file (must use chrome.fileSystem.chooseEntry or have a retained entry on the file or its containing directory) and get a FileEntry object, you can then create a

Loading local content through XHR in a Chrome packaged app

大憨熊 提交于 2019-11-30 14:14:26
问题 I'm trying to load in a web app that I've built using Backbone and it pulls in JSON and HTML template files that are stored locally. I was wondering with Chrome packaged apps whether it's possible to load these files by using some sort of 'get'/ajax request? Currently I'm getting this... OPTIONS chrome-extension://fibpcbellfjkmapljkjdlpgencmekhco/templates/templates.html Cannot make any requests from null. jquery.min.js:2 XMLHttpRequest cannot load chrome-extension:/

Load local file in Chrome App Webview

假装没事ソ 提交于 2019-11-30 13:54:00
In Chrome packaged apps you can use to load external pages inside the app. Is there a way to make them load a local file (an html file inside the packaged app)? I can't use iframe, because iframe wont support external resources (scripts, images, whatever). Don't have any code to show, but try this: Assuming you can read the local file (must use chrome.fileSystem.chooseEntry or have a retained entry on the file or its containing directory) and get a FileEntry object, you can then create a FileReader to get the file as a data URL. Then you can use that data URL directly in a webview. (Must have

unlimited file storage in chrome app

大憨熊 提交于 2019-11-30 10:19:14
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.chooseEntry function, which means the user needs to go through a dialog box. The regular fileSystem API

Loading local content through XHR in a Chrome packaged app

…衆ロ難τιáo~ 提交于 2019-11-30 10:01:17
I'm trying to load in a web app that I've built using Backbone and it pulls in JSON and HTML template files that are stored locally. I was wondering with Chrome packaged apps whether it's possible to load these files by using some sort of 'get'/ajax request? Currently I'm getting this... OPTIONS chrome-extension://fibpcbellfjkmapljkjdlpgencmekhco/templates/templates.html Cannot make any requests from null. jquery.min.js:2 XMLHttpRequest cannot load chrome-extension://fibpcbellfjkmapljkjdlpgencmekhco/templates/templates.html. Cannot make any requests from null. I can't find any real information

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

廉价感情. 提交于 2019-11-30 09:51:05
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? The thing is that by default a webview will not let the guest open arbitrary windows. Instead, it will issue a 'newwindow' event, which you can intercept and decide what to do with it. In a less

How do you get the device name (or hostname) from a Chrome Extension?

强颜欢笑 提交于 2019-11-30 08:46:26
问题 Is there a way to retrieve the device name from a Chrome Extension? Ideally I'd like to get the same String that is displayed in the 'Other devices' menu on the new tab page... Is that piece of information available to extensions? Alternatively, is the hostname available? What I managed to get is the user-agent by accessing window.navigator.userAgent , but that's it... 回答1: No. A persistent and unique identifier associated with the user's hardware would basically be an undeletable cookie. For

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

a 夏天 提交于 2019-11-30 07:15:00
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) 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 kzahel Try just typing: chrome.storage.local.get(function(data) { console.log(data); }); then look in the console. 来源: https:/