google-chrome-app

Keep Chrome Packaged App running in background?

青春壹個敷衍的年華 提交于 2019-12-12 22:12:30
问题 I'm trying to build a Chrome app and/or extension to communicate with a serial device (using https://developer.chrome.com/apps/serial), to use for showing data from the device on a webpage. I've created an app that can read messages from my device but I now need to get those messages to my webpage. My plan was to create an extension that communicates with my app and then updates my webpage. My extension sends messages to the app using "chrome.runtime.sendMessage" and my app then responds with

How to wait for page to finish loading all content before running script or how to best detect major DOM changes

老子叫甜甜 提交于 2019-12-12 19:33:18
问题 I'm making a text replacing extension (of sorts) using the method described here as a basis for replacing text. Here is the important piece of code var elements = document.getElementsByTagName('*'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; for (var j = 0; j < element.childNodes.length; j++) { var node = element.childNodes[j]; if (node.nodeType === 3) { var text = node.nodeValue; var replacedText = text.replace(/[word or phrase to replace here]/gi, '[new word or

chrome.runtime.reload blocking the extension

久未见 提交于 2019-12-12 18:04:57
问题 So, I'm developing a plugin for webpack for hot-reloading the chrome extensions. The biggest problem is, if I call a certain number of times the "chrome.runtime.reload()" this will make Chrome block the extension: This extension reloaded itself too frequently. On a old discussion they said that if you call the reload more than 5 times in a 10 seconds time frame, your extension will be blocked. The thing is, I've throttled the reloading a lot (like max 1 call each 5 seconds) and this still

How to open chrome in incognito tab

时光怂恿深爱的人放手 提交于 2019-12-12 17:04:36
问题 I have a scenario open a web link in incognito tab in chrome browser. I am using adb command to open chrome and navigate to specific URL i.e adb shell am start -n com.android.chrome/com.google.android.apps.chrome.Main -d weburl . Is there any way to open link directly in incognito mode through adb? 回答1: I could not find any way using adb commands. But using ChromeOptions it is possible if we add " --incognito " argument. 回答2: You can launch chrome in incognito mode with the -incognito flag. I

How to set full width and height for chrome new window

强颜欢笑 提交于 2019-12-12 16:06:42
问题 How can I create new window with full of available space in display screen. function CreateWindow () { chrome.app.window.create("Spreadsheet.html" , { "bounds" : { "width" : 500, // need full width and height "height": 400 } }); } chrome.app.runtime.onLaunched.addListener(CreateWindow); 回答1: You cannot access window.innerWidth and height though you can use below code function CreateWindow () { chrome.app.window.create("Spreadsheet.html" , { "bounds" : { "width" : window.screen.availWidth,

Why chrome.sockets.tcp.create() does not work in app background script?

北慕城南 提交于 2019-12-12 11:36:50
问题 I am trying to create a tcp socket in the background script of my app. The error is (first line in 1.js ): Uncaught TypeError: Cannot read property 'tcp' of undefined Background script 1.js : chrome.sockets.tcp.create({}, function(createInfo) { chrome.sockets.tcp.connect(createInfo.socketId, "127.0.0.1", 4005, function(socketInfo) { }); }); Manifest file : { "manifest_version": 2, "name": "UDP TEST", "version": "1.0", "app": { "background": { "scripts": ["1.js"] } }, "permissions": [ {

Can I get intellisense for chrome apps and extensions?

帅比萌擦擦* 提交于 2019-12-12 10:09:46
问题 Is there any way to get javascript IntelliSense for developing Google Chrome apps and extensions in Visual Studio 2012? 回答1: You can include this file found at GitHub: chrome.intellisense.js place the file in the same directory as the file you are working on and add the following line at the top of your source file. /// <reference path="chrome" /> This also works in VS 2013 and should work in Visual Studio 2010 and 2013 as well, but is not tested. 来源: https://stackoverflow.com/questions

Can I access USB HID device via a Chrome App?

陌路散爱 提交于 2019-12-12 08:54:53
问题 I have a simple little dongle I want to debug by sending/receiving basic USB messages. It enumerates as an HID device (like an additional mouse), but am worried that I won't have access to it. I forgot the hardware and can't test with it for a couple days. Is it a futile effort to continue building a chrome extension to test it? Chrome App, USB documentation: https://developer.chrome.com/apps/app_usb Getting-started example: https://github.com/GoogleChrome/chrome-app-samples/tree/master/usb

Chrome Packaged App - Use AngularJS in background/event page

我的梦境 提交于 2019-12-12 07:55:52
问题 As we create a chrome app, we put scripts on the background property in the manifest.json file ( this will serve as the app's background/event page ) . What I want is, I want to use AngularJS on background script but I dont know how. And also, is it possible? I just saw some answer but it is for chrome extensions. I tried to use that solution in chrome app but it didnt worked. --EDIT-- What I did was, I changed some from manifest.json file from this .. "app": { "background": { "scripts": [

error “Cannot return to provided redirect_uri” in chrome extension using stackapp auth 2.0

自闭症网瘾萝莉.ら 提交于 2019-12-12 06:14:28
问题 I follow the tutorial here https://developer.chrome.com/apps/app_identity and use the api here https://developer.chrome.com/apps/identity but with no luck. Could anyone point out is anything wrong in this code? function onGoogleLibraryLoaded() { var redirect_uri = chrome.identity.getRedirectURL("http://qqibrow.github.io"); var full_url = "https://stackexchange.com/oauth/dialog?client_id=4716&redirect_uri=" + redirect_uri; console.log(redirect_uri); console.log(full_url); chrome.identity