google-chrome

How to call a function from injected script?

痞子三分冷 提交于 2021-01-27 06:45:48
问题 This is code from my contentScript.js : function loadScript(script_url) { var head= document.getElementsByTagName('head')[0]; var script= document.createElement('script'); script.type= 'text/javascript'; script.src= chrome.extension.getURL('mySuperScript.js'); head.appendChild(script); someFunctionFromMySuperScript(request.widgetFrame);// ReferenceError: someFunctionFromMySuperScript is not defined } but i got an error when calling a function from injected script: ReferenceError:

Chrome extension browser action event not firing

ⅰ亾dé卋堺 提交于 2021-01-27 06:35:32
问题 I want to make chrome extension which opens all my favourite websites when I click on it. Currently my manifest.json is: { "manifest_version": 2, "name": "Soical_open", "description": "This extension opens all my favorite social sites once", "version": "1.0", "background": { "scripts": ["background.js"] } } and my background.js is: var queue = ['www.fb.com', 'www.gmail.com' , 'www.quora.com']; chrome.browserAction.onClicked.addListener(function(tab) { for (var i=0; i<queue[1].length; ++i)

Chrome extension browser action event not firing

非 Y 不嫁゛ 提交于 2021-01-27 06:35:02
问题 I want to make chrome extension which opens all my favourite websites when I click on it. Currently my manifest.json is: { "manifest_version": 2, "name": "Soical_open", "description": "This extension opens all my favorite social sites once", "version": "1.0", "background": { "scripts": ["background.js"] } } and my background.js is: var queue = ['www.fb.com', 'www.gmail.com' , 'www.quora.com']; chrome.browserAction.onClicked.addListener(function(tab) { for (var i=0; i<queue[1].length; ++i)

Chrome not reachable

喜你入骨 提交于 2021-01-27 06:31:41
问题 I am getting the below error message when running my unit tests. Can anyone tell me what is causing this and how to resolve? Error: chrome not reachable (Driver info: > chromedriver=0.7,platform=Windows NT 6.1 x86) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 21.58 seconds 来源: https://stackoverflow.com/questions/16178753/chrome-not-reachable

Workaround stalling chrome when xdebug session cookie set?

╄→гoц情女王★ 提交于 2021-01-27 06:08:28
问题 This is a bit specific situation, I wonder if anyone else has encountered the following: Chrome starts stalling when xdebug session cookie is set. The cookie might be leftover from previous debugging, all requests (ajax or "normal") slow down (15 seconds to 2 minutes before starting to receive), when debugging is not in use. I use PHPStorm for debugging, but it makes no difference if phpstorm is running or not when the stalling takes place. EDIT: Steps to reproduce the stalling: Open php

Why is Firefox MUCH faster than Chrome when loading 'big' documents?

我只是一个虾纸丫 提交于 2021-01-27 05:49:50
问题 I'm trying to troubleshoot an issue with bad acceptance of custom html build-reports that require a very long time to load on googlechrome, whereas load time is much better on firefox. talking about ~5 sec. vs ~110 sec. (measured with firefox & googlechrome profiler) the file is about 10MB in size imo there is nothing 'special' about the html file. the reports are usually loaded with anchor suffix, so the browser should jump to the very end of the file (='summary section') when it's loaded. I

Why is Firefox MUCH faster than Chrome when loading 'big' documents?

♀尐吖头ヾ 提交于 2021-01-27 05:48:44
问题 I'm trying to troubleshoot an issue with bad acceptance of custom html build-reports that require a very long time to load on googlechrome, whereas load time is much better on firefox. talking about ~5 sec. vs ~110 sec. (measured with firefox & googlechrome profiler) the file is about 10MB in size imo there is nothing 'special' about the html file. the reports are usually loaded with anchor suffix, so the browser should jump to the very end of the file (='summary section') when it's loaded. I

moment.js gives invalid date in firefox, but not in chrome

此生再无相见时 提交于 2021-01-27 05:27:38
问题 I'm having a strange issue with moment.js. I wrote a function to convert the time from utc to german time format, and everything seemed to work just fine in chrome. But now I tried it with firefox and here I got an invalid date. moment.locale("de"); $('#from').datepicker({ format: "DD. MMMM YYYY" }); $('#from').on('change',function() { var a = moment($('#from').val(), "DD. MMMM YYYY").format("LLLL"); var b = moment(a).add(7,'days'); var localTime = moment.utc(b).toDate(); localTime = moment

Why doesn't event bubbling work in detached DOM elements?

北战南征 提交于 2021-01-27 05:12:08
问题 I have a parent <div> with one child <div> in memory - not attached to the current document. I want to trigger a CustomEvent on the child but listen to that event from the parent. Here is my code: var parent = document.createElement('div'); var child = document.createElement('div'); parent.appendChild(child); parent.addEventListener('boom', function(event) { console.log('parent listener', event); // <~ This never runs! }); var event = new CustomEvent('boom', { bubbles: true }); child

Why doesn't event bubbling work in detached DOM elements?

烈酒焚心 提交于 2021-01-27 05:11:07
问题 I have a parent <div> with one child <div> in memory - not attached to the current document. I want to trigger a CustomEvent on the child but listen to that event from the parent. Here is my code: var parent = document.createElement('div'); var child = document.createElement('div'); parent.appendChild(child); parent.addEventListener('boom', function(event) { console.log('parent listener', event); // <~ This never runs! }); var event = new CustomEvent('boom', { bubbles: true }); child