Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix($$RAFProvider): prevent a JavaScript error in Firefox #16192

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/ng/raf.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ function $$RAFProvider() { //rAF
var rafSupported = !!requestAnimationFrame;
var raf = rafSupported
? function(fn) {
var id = requestAnimationFrame(fn);
return function() {
cancelAnimationFrame(id);
};
var id = requestAnimationFrame.call($window, fn);
return cancelAnimationFrame.bind($window, id);
}
: function(fn) {
var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666
Expand Down
15 changes: 15 additions & 0 deletions test/extension/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"description": "Test extension for angular.js",
"manifest_version": 2,
"name": "Angular test",
"version": "1.0",
"content_scripts": [
{
"matches": ["https://www.google.ch/*"],
"js": [
"angular.js",
"test.js"]
}
]

}
9 changes: 9 additions & 0 deletions test/extension/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var html = document.querySelector('html');
html.setAttribute('ng-app', '');

var buttonDiv = document.createElement('div');
buttonDiv.setAttribute('ng-show', 'true');
buttonDiv.innerHTML = 'Hello!';

var hplogo = document.getElementById('hplogo');
hplogo.insertBefore(buttonDiv, hplogo.childNodes[0]);