google-chrome-app

Maximum files of a directory that can be read by FileReader#readEntries in JavaScript

陌路散爱 提交于 2019-12-05 07:54:42
I'm creating a Chrome application. I must read the files of a directory and I am using the DirectoryEntry API and DirectoryReader API . My problem is that the maximum files read using DirectoryReader#readEntries is 100, the first 100 (alphabetical order) var reader = currentDir.createReader(); var read = reader.readEntries.bind(reader, function(files) { for ( var i = 0; i < files.length; i++){ if (files[i].name == nameSearches){ callback(files[i]); } } }) callback(undefined) } read(); The value of files.length is 100 and there are more files in the directory I'm not sure if this limitation is

Get id_token with Chrome Identity API

亡梦爱人 提交于 2019-12-05 05:28:25
I am developping a Google Chrome extension, to allow users to authenticate with their Google Accounts, i decided to use Chrome Identity API . To authenticate the user in my Application i need to get the ID_Token (signed token) is there a way to get OpenID Connect Token with Google Chrome Identity API ? Thanks for your help ! Piotr Sobiech This is a paste of my answer from the other thread https://stackoverflow.com/a/32548057/3065313 I've came to the same problem yesterday and since I've found a solution, I might as well share it, as it wasn't that obvious. As far as i know Google does not

Chrome App SecurityError on file creation

你离开我真会死。 提交于 2019-12-05 05:14:10
I have the following code: chrome.runtime.getPackageDirectoryEntry(function(directoryEntry) { directoryEntry.getFile("files/test.txt", {create: true, exclusive: false}, function(fileEntry) { console.log(fileEntry); }, function(error) { console.log(error); }); }); If the file does not exist and create is true I get an It was determined that certain files are unsafe for access within a Web application, or that too many calls are being made on file resources. error. But if it does exist and create is false I get access to the file. What am I doing wrong? 来源: https://stackoverflow.com/questions

How to show images in other domains / Chrome Packaged Apps

扶醉桌前 提交于 2019-12-05 04:09:22
问题 I have a JSON which returns a list of URLs of images to access the JSON that is already placed in a field in this domain whitelist manifest.json, however when I try to view the pictures it complains that it can not access the images. 1 - How to Perm can display images that are not within the package App 2 - How can I download the images to download the APP and then display to this second question I used the RAL, a lib trial google and it worked, however I could not make a test using this

Parts of the UI keep disappearing in a Chrome app

此生再无相见时 提交于 2019-12-05 00:53:32
I'm working on a Chrome app called Postman ( https://chrome.google.com/webstore/detail/postman-rest-client-packa/fhbjgbiflinjbdggehcddcbncdddomop ). While using Postman on a Macbook with a retina display, a weird problem keeps cropping up. Sometimes (about 1 in 20 clicks), clicking on a UI element makes half the UI vanish. The 'Elements' tab of dev tools shows the correct structure - all the divs are there, with display: block. They're just not rendered. Resizing the window by a tiny amount forces a redraw, and all elements become visible again. (I'm currently using Chrome v 37.0.2062.94)

How to get event ID from Google Calendar page with JavaScript?

﹥>﹥吖頭↗ 提交于 2019-12-04 21:46:14
问题 I am creating a Google Chrome extension for Google calendar. I want to get the ID of an event when user visits the event edit page. How can I get the event ID from the plugin's javascript code so that I can fire Calendar api v3.0 with that ID. Adding extra info: Google Calendar API calendar id and event id The comment by @krishna actualy shows how to get the event ID and it works. But how to get the event ID in https://www.google.com/calendar/ URL not in the URL(https://www.google.com

Is it possible to message the dev-tools panel from within inspectedWindow.eval?

僤鯓⒐⒋嵵緔 提交于 2019-12-04 19:10:27
I have been reading over the chrome extension message passing documentation , but I cannot seem to establish communication from within the inspected window. For example, chrome.devtools.inspectedWindow.eval('function() { . . . /* send message to dev-tools panel */ chrome.runtime.sendMessage({foo:"foo"});<-- Uncaught Error: Invalid arguments to connect. Why is the extensionId required within chrome.devtools.inspectedWindow.eval? This made me step back and ask the question. }') I have tried leveraging both background and content scripts to listen for these messages, but nothing seems to trigger.

How to display data URI for PDF in Chrome App?

ⅰ亾dé卋堺 提交于 2019-12-04 17:51:36
I have a data URI generated from a JavaScript PDF library (jsPDF) that seems to be OK, because when I display it with console.log and paste it into a browser URL field, it works. However, I can't get it to display from within the Chrome App, either in a Chrome App window or an ordinary browser window. The URI starts like this: var uri = "data:application/pdf;base64,JVBERi0xLjMK ..."; When I do this: chrome.app.window.create(uri); The window opens, but it is trying to load the URI: chrome-extension://gapkhdeaendagkjpchhemfhbpfcjgmep/data:application/pdf;base64,JVBERi0xLjMK ... and in the window

Do 'Chrome Apps for Mobile' use native web-view on each platform?

非 Y 不嫁゛ 提交于 2019-12-04 15:40:15
Is Chrome Apps For Mobile only a collection of Apache Cordova plugins for each mobile platform or does it intend to also replace the native web-view with Chrome based web-view ? This question and this slide on Google Docs seem to indicate that it is only a collection of plugins. This question says that on iOS it uses the native web-view. What about on Android and any future platforms Google might support? Yes, all current Chrome Apps for Mobile using the cca toolkit are cordova based and thus use the Native system WebView. On iOS, this currently seems unlikely to change because of policy

Chrome packaged app onblur listener?

妖精的绣舞 提交于 2019-12-04 12:53:27
Is there any event listeners for a chrome packaged app to tell if the app has lost focus? I'm trying to make a game, but I can't seem to make it pause when I change the focus. I've tried a few different things such as the following, but none seem to work. document.onblur = pause; document.addEventListener('blur', pause, false); canvas.onblur = pause; canvas.addEventListener('blur', pause, false); window.onblur = pause; window.addEventListener('blur', pause, false); chrome.app.window.onblur = pause; chrome.app.window.onBlur = pause; chrome.app.window.onblurred = pause; chrome.app.window