"window.openDatabase is not a function" error in chrome app - html

When i run my index.html from chrome browser everything works fine but after i created a chrome app from the same files and tried to run the app i get "window.openDatabase is not a function" error.Did i miss something? I've heard that WEBsql is being depreciated but if that's the problem then why is it working on my browser?The only change i made to the folder with my html/js/css files in order to create the chrome app was adding a manifest and a background.js,i also changed window.localstorage with chrome.storage.local

Chrome has refused to support it in apps.
Given that WebSQL is deprecated, it's extremely unlikely that we'd expose the API in new contexts.
It has been noted that you can workaround by using it inside a webview. Here is the relevant issue.

Related

ExtensionInstallSources in Chrome extensions for Enterprise policy

We have google chrome extension that needs to be used inside our organization. We have domains there.
Based on enterprise options the easiest approach for us is to host it on some internal web server, and then add address of that internal site as ExtensionInstallSources option to users PC via Group policies, but this does't work for me.
I've tried both registry and local Group Policy changes by adding Google Chrome adm\admx files.
Here is my registry change:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources]
"1"="http://localhost/*"
When i'm checking chrome://policy - it displays that it loaded this settings. But when i open http://localhost/myextension.crx - Chrome still displays an error that extension can't be installed from there...
I'm using 47.0.2526.106 m (64-bit) under Windows 8.1 Enterprise (x64)
What i'm doing wrong here?
I have more complicated option to download chrome source\pdbs, and then try to debug it to get understanding why it's not working but it may take a lot of time, as Chrome can compile for a couple of hours on Windows at first build....
So apparently this registry change just wasn't enough. After debugging chrome source i found why it doesn't work for me. I missed:
The referer MUST be present and it also should be whitelisted. So if i open url for my extension by direct link, then as referer is missing - it won't install it. (Oh Chrome, at least you could say with message about it...). If i have web page that has link to that extension, and it's also whitelisted, then it will work fine.
Second missed point was that extension id MUST be present in ExtensionInstallWhitelist, otherwise Chrome will install it and with 2-3 seconds delay will disable it. But if you have listed it under ExtensionInstallWhitelist, then it will be fine.
So my final registry change for localhost is:
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome]
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallSources]
"1"="http://localhost/*"
[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallWhitelist]
"1"="fhojekmcngnmkdbcoegjdlojgfngkpak"
I found it after long debugging in ExtensionManagement class - https://code.google.com/p/chromium/codesearch#chromium/src/chrome/browser/extensions/extension_management.cc&q=ExtensionManagement::IsOffstoreInstallAllowed&sq=package:chromium&type=cs&l=148

What is the easy way of installing chrome app from folder, for development, after loading will be disallowed?

Google Chrome will start disallowing developers from installing Chrome apps by loading them from a folder as it's possible today (see the recent news from chromium team).
However, the proposed solution seems really complicated to me and I don't understand it at all (for example, I don't have any CRX file in the first place, I just have some javascript files and manifest in a folder).
So, I want to ask. I am developing an extension that I have in a folder. How to easily load the extension in Chrome after the protections will start being enforced everywhere?
It seems I misunderstood the news. Installing through "Load unpacked extension" will still be possible, as explained here
https://www.chromium.org/developers/extensions-deployment-faq#TOC-Will-this-affect-my-ability-to-develop-my-extensions-on-Windows-

How to detect event when chrome packaged app uninstalled?

I am developing a chrome packaged app. As part of the app i need to know, when user uninstalled the app. I could not find any method as part of the API,to read such a event when it happens. In extensions we have chrome.management api to do this, but chrome packaged app doesn't have this permission. Any help would be highly appreciated.
Try using chrome.runtime.setUninstallURL, this allows you to set a URL which is loaded as soon as the App is removed from Chrome. It does not require any additional permissions.

Chrome 39 renders a compiled Dart app as blank

I am using Dart 1.8.3, Windows 8.1, Chrome 39.0.2171.95 m
Build a sample Polymer app from File > New Project dialog and chose polymerapp. It works fine in Dartium.
Compile to JS. Works fine in Firefox, but only shows a blank page in Chrome:
Searched here for some relevant topics and still getting nowhere. Would appreciate hints and guidance.
I guess this is because you need to start Chrome with --allow-file-access-from-files in order to be able or load local files.
Alternatively try to load the page from pub serve which does Dart2JS compilation on the fly (launch the page from DartEditor and then copy the URL from Dartium to Chrome).
Use any web server Python simplehttpserver or create on in Dart with a few lines of code.
I did the following test: deploy the build directory into my web server and it works fine. Thanks for the hint from Zochbauer that leads me to this.
In my view, this problem is more or less solved.

FileReader API working in jsFiddle, but not from local file

I'm working on a Chrome/Firefox extension which will be using the file API to store files locally. I'm trying to get an example up and running but I'm running into issues which seem to center around Chrome. Can anyone explain why this jsFiddle works fine, but the exact same code, when run from a local file, doesn't work. Please note that it works fine in Firefox, just not in Chrome. Any ideas?
Chrome has unusually restrictive web security; many things, like Ajax, won't work when run locally. This is one of them. You can get around this problem by either using a local websever, like #ephemient suggests, or you can run Chrome in unsafe mode for testing:
chrome.exe --disable-web-security
Yep. Chrome's SOP prevents just about everything in file:// from working[1]. Use a local webserver instead.
If you are using chrome. Start the chrome from command line with the flag
--allow-file-access-from-files
chrome doesn't support for accessing local file without this flag.