How to solve different FPS in requestAnimationFrame on different browsers? I am making a 3D game using THREE.js that uses requestAnimationFrame and it is fast on Google Chrome 15. However, it is really slow on Firefox 6 and really really slow (slower than Firefox) on IE9. This is really a big problem and I am wondering if there is a
Tag: google-chrome
Detecting if code is being run as a Chrome Extension
I am working with some code that needs to be run as a page, and if it’s being run as a Chrome Extension, I want to be able to do additional things. What I’m using is: This seems like a good capability detection. Using user agent string causes me trouble because it’s the same no matter the context (web page
JavaScript: Scroll to selection after using textarea.setSelectionRange in Chrome
A JavaScript function selects a certain word in a textarea using .setSelectionRange(). In Firefox, the textarea automatically scrolls down to show the selected text. In Chrome (v14), it does not. Is there a way to get Chrome to scroll the textarea down to the newly selected text? jQuery solutions are welcome. Answer Here is a simple and efficient solution in
Page reload in Chrome unnecessarily triggers bound events just prior to reloading the page
Hope someone has a good answer to this: Why does Chrome (14.0) triggers the document ready and window load events when I refresh the page? Note that I am not talking about what happens when the new page loads, but before it has loaded. See the following code: When I first visit page I get two outputs on console, one
Check whether user has a Chrome extension installed
I am in the process of building a Chrome extension, and for the whole thing to work the way I would like it to, I need an external JavaScript script to be able to detect if a user has my extension installed. For example: A user installs my plugin, then goes to a website with my script on it. The
Getting cookies in a google chrome extension [duplicate]
This question already has answers here: How do I return the response from an asynchronous call? (41 answers) Closed 25 days ago. I am trying to get a cookie specifically from a domain using this code: The problem is that the alert always says undefined. However, if I change to it works properly. How do I save the value to
Is there a way to increase the size of localStorage in Google Chrome to avoid QUOTA_EXCEEDED_ERR: DOM Exception 22
I’ve written a webapp that allows you to store the images in the localStorage until you hit save (so it works offline, if signal is poor). When the localStorage reaches 5MB Google Chrome produces an error in the javascript console log: Uncaught Error: QUOTA_EXCEEDED_ERR: DOM Exception 22 How do I increase the size of the localStorage quota on Google Chrome?
How to wait until an element exists?
I’m working on an Extension in Chrome, and I’m wondering: what’s the best way to find out when an element comes into existence? Using plain javascript, with an interval that checks until an element exists, or does jQuery have some easy way to do this? Answer DOMNodeInserted is being deprecated, along with the other DOM mutation events, because of performance
Copy text to clipboard from bookmarklet
I’m trying to write a little bookmarklet that can extract some text from the active page and load that into the clipboard. The extraction is easy enough, but I’m really stuck doing the clipboard-copying part. Currently, I’m just alerting the text and hitting Ctrl+C to copy the text from the message-box, which isn’t ideal. I’ve read How to Copy to
Chrome sendrequest error: TypeError: Converting circular structure to JSON
I’ve got the following… which calls the following.. However, my code never reaches “ZOMG HERE” but rather throws the following error while running chrome.extension.sendRequest Does anyone have any idea what is causing this? Answer It means that the object you pass in the request (I guess it is pagedoc) has a circular reference, something like: JSON.stringify cannot convert structures like