google-chrome-app

Chrome App CSP violation after Dart/Polymer transform/compile to JavaScript

廉价感情. 提交于 2019-12-01 00:23:31
Alright-- so there are a lot of similar questions regarding Polymer after dart2js . I am seemingly running into an issue that's specific to doing this but also running it as a Chrome app. I have discovered that the outcome varies depending on the order of the transformers (which is expected). Here's my results so far: transformers: - chrome - polymer: entry_points: web/example.html csp: true - $dart2js: csp: true This works great in browser but fails when run as a Chrome app. Error: Uncaught TypeError: Cannot read property 'apply' of undefined (in the example.html_bootstrap.dart.js file) From

Connecting to an iOS device using the chrome.bluetoothLowEnergy API

拜拜、爱过 提交于 2019-12-01 00:19:28
I have been trying to connect an iPhone 5 to OSX Chrome (Version 38.0.2096.0 dev) over BLE using chrome.bluetoothLowEnergy API. I'm using BLE Utility on my iphone to simulate battery service. I can discover the service and connect to it using other phones or OSX utility , but I'm having problems doing so with chrome. I can see my device listed, but no services discovered and when I try to connect to the device, connection fails with the following message: Operation failed I would greatly appreciate any help. Here is my code: manifest.json { "name": "BLE Test", "description": "Chrome BLE Test",

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

寵の児 提交于 2019-11-30 22:28:30
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 accessible by node application code (in JavaScript). This confuses me. mmocny Sounds like your primary

javascript - getting the return data of a async function inside a function

痴心易碎 提交于 2019-11-30 20:28:56
I am having a problem because chrome api functions are async and I cant get its return value. Consider the following code. I am using angularjs $scope.storageGet = function(param) { var returnData; chrome.storage.local.get(param.storageName, function(data) { returnData = data; }); return returnData; }; And when I tried to call it like this: console.log($scope.storageGet({'storageName': 'users'})); It prints 'undefined' in the console. What I want to see is the obect of users stored in chrome storage. Well, I'm sure that I have data in chrome storage. Another way is to use a promise. In this

How to open a link in chrome browser, even though the default computer browser is 'Safari'?

删除回忆录丶 提交于 2019-11-30 19:45:44
问题 I've built a chrome packaged app, and I'm trying to make one of the buttons in it open the chrome browser in a specific link. For this, I used window.open("http://myLink.com") , which works, but unfortunately it opens the default browser rather than chrome. Is there a way around this? 回答1: This only happens from inside the app window. If you call window.open from the background page, it will open in Chrome. So, send it to your background page: // app window function openInChrome(url) { chrome

Connecting to an iOS device using the chrome.bluetoothLowEnergy API

青春壹個敷衍的年華 提交于 2019-11-30 19:34:14
问题 I have been trying to connect an iPhone 5 to OSX Chrome (Version 38.0.2096.0 dev) over BLE using chrome.bluetoothLowEnergy API. I'm using BLE Utility on my iphone to simulate battery service. I can discover the service and connect to it using other phones or OSX utility, but I'm having problems doing so with chrome. I can see my device listed, but no services discovered and when I try to connect to the device, connection fails with the following message: Operation failed I would greatly

How to communicate with WebView in Chrome App?

拟墨画扇 提交于 2019-11-30 19:26:58
问题 I have developed a website which I intend to display inside a webview, within a Chrome App. This works fine. Now, I want to use postMessage from the website, to send messages out of the webview and into the containing Chrome App. This is done via top.postMessage inside the webview. I've tried the following event listeners: webView.contentWindow.addEventListener('message', messageHandler); webView.addEventListener('message', messageHandler); window.addEventListener('message', messageHandler);

Chrome App CSP violation after Dart/Polymer transform/compile to JavaScript

折月煮酒 提交于 2019-11-30 19:00:26
问题 Alright-- so there are a lot of similar questions regarding Polymer after dart2js . I am seemingly running into an issue that's specific to doing this but also running it as a Chrome app. I have discovered that the outcome varies depending on the order of the transformers (which is expected). Here's my results so far: transformers: - chrome - polymer: entry_points: web/example.html csp: true - $dart2js: csp: true This works great in browser but fails when run as a Chrome app. Error: Uncaught

Chrome extension: onclick() event not triggering alert() popup [duplicate]

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-30 18:04:22
问题 This question already has answers here : onClick within Chrome Extension not working (4 answers) Closed 5 years ago . Unable to trigger alert() popup with onclick() event code: manifest.json: { "name": "Project", "version": "1.0.0", "manifest_version": 2, "description": "Popup when website requires Log in", "browser_action":{ "default_icon":"icon_19.png", "default_popup":"Popup.html" } } Popup.html: <html> <head></head> <body> <div class="plus" onclick="popup()"></div> <script src="inline.js"

Cordova chrome.socket API. Any example?

心不动则不痛 提交于 2019-11-30 17:57:47
问题 I am trying to use org.chromium.socket plugin. But I cannot find many examples. Here is my code: var connButton = document.getElementById("connButton"); connButton.addEventListener("click", doConnect, false); function doConnect() { var theSocketId = 0; chrome.socket.create("tcp", null, function(createInfo) { alert(createInfo.socketId); theSocketId = createInfo.socketId; }); chrome.socket.connect(theSocketId, "http://www.yahoo.com", 80, function(result) { alert(result); }); chrome.socket.read