mirror of
https://github.com/turuslan/HackTimer
synced 2024-11-21 15:10:11 +00:00
Merge branch 'master' of https://github.com/ctubio/HackTimer_fork into ctubio-master
# Conflicts: # README.md
This commit is contained in:
commit
7e7b1fe8e0
@ -137,7 +137,6 @@ onmessage = function (event) {\
|
||||
worker.onerror = function (event) {
|
||||
console.log (event);
|
||||
};
|
||||
console.log (logPrefix + 'Initialisation succeeded');
|
||||
} catch (error) {
|
||||
console.log (logPrefix + 'Initialisation failed');
|
||||
console.error (error);
|
||||
@ -145,4 +144,4 @@ onmessage = function (event) {\
|
||||
} else {
|
||||
console.log (logPrefix + 'Initialisation failed - HTML5 Web Worker is not supported');
|
||||
}
|
||||
}) ('HackTimerWorker.js');
|
||||
}) ('HackTimerWorker.js');
|
||||
|
39
README.md
39
README.md
@ -1,11 +1,32 @@
|
||||
# Deprecated
|
||||
## Use [chrisguttandin/worker-timers](https://github.com/chrisguttandin/worker-timers) instead
|
||||
Use monkey-patching to replace default `window.setInterval`, `window.clearInterval`, `window.setTimeout`, `window.clearTimeout`.
|
||||
# HackTimer
|
||||
Avoid timers throttling by browser when tab is inactive
|
||||
|
||||
```js
|
||||
import * as workerTimers from 'worker-timers';
|
||||
window.setInterval = workerTimers.setInterval;
|
||||
window.clearInterval = workerTimers.clearInterval;
|
||||
window.setTimeout = workerTimers.setTimeout;
|
||||
window.clearTimeout = workerTimers.clearTimeout;
|
||||
# Usage:
|
||||
Place script reference to **HackTimer.js** (or HackTimer.min.js) before any other JavaScript.
|
||||
This includes library's such as jQuery as otherwise timed events such as fadeOut and fadeIn will break.
|
||||
|
||||
# NPM
|
||||
Command: `npm install hacktimer`
|
||||
|
||||
Latest version is 1.1.0
|
||||
|
||||
Registry URL: https://www.myget.org/F/hack-timer/npm
|
||||
|
||||
# Bower
|
||||
Command: `bower install hacktimer`
|
||||
|
||||
Latest version is 1.1.0
|
||||
|
||||
Registry: https://www.myget.org/F/hack-timer/bower/
|
||||
|
||||
You can specify bower registry in file `.bowerrc` in your working directory
|
||||
```json
|
||||
{
|
||||
"registry": {
|
||||
"search": [
|
||||
"https://www.myget.org/F/hack-timer/bower/",
|
||||
"https://bower.herokuapp.com"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
11
package.json
11
package.json
@ -1,14 +1,11 @@
|
||||
{
|
||||
"name": "hacktimer",
|
||||
"version": "1.1.0",
|
||||
"version": "1.1.3",
|
||||
"description": "Avoid timers throttling by browser when tab is inactive",
|
||||
"main": "HackTimer.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/turuslan/HackTimer.git"
|
||||
"url": "git+https://github.com/ctubio/HackTimer.git"
|
||||
},
|
||||
"keywords": [
|
||||
"suspend",
|
||||
@ -25,7 +22,7 @@
|
||||
"author": "turuslan <turuslan.devbox@gmail.com> (http://github.com/turuslan/)",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/turuslan/HackTimer/issues"
|
||||
"url": "https://github.com/ctubio/HackTimer/issues"
|
||||
},
|
||||
"homepage": "https://github.com/turuslan/HackTimer"
|
||||
"homepage": "https://github.com/ctubio/HackTimer"
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user