Merge branch 'master' of https://github.com/ctubio/HackTimer_fork into ctubio-master

# Conflicts:
#	README.md
This commit is contained in:
turuslan 2018-10-12 07:02:44 +03:00
commit 7e7b1fe8e0
3 changed files with 35 additions and 18 deletions

View File

@ -137,7 +137,6 @@ onmessage = function (event) {\
worker.onerror = function (event) { worker.onerror = function (event) {
console.log (event); console.log (event);
}; };
console.log (logPrefix + 'Initialisation succeeded');
} catch (error) { } catch (error) {
console.log (logPrefix + 'Initialisation failed'); console.log (logPrefix + 'Initialisation failed');
console.error (error); console.error (error);
@ -145,4 +144,4 @@ onmessage = function (event) {\
} else { } else {
console.log (logPrefix + 'Initialisation failed - HTML5 Web Worker is not supported'); console.log (logPrefix + 'Initialisation failed - HTML5 Web Worker is not supported');
} }
}) ('HackTimerWorker.js'); }) ('HackTimerWorker.js');

View File

@ -1,11 +1,32 @@
# Deprecated # HackTimer
## Use [chrisguttandin/worker-timers](https://github.com/chrisguttandin/worker-timers) instead Avoid timers throttling by browser when tab is inactive
Use monkey-patching to replace default `window.setInterval`, `window.clearInterval`, `window.setTimeout`, `window.clearTimeout`.
```js # Usage:
import * as workerTimers from 'worker-timers'; Place script reference to **HackTimer.js** (or HackTimer.min.js) before any other JavaScript.
window.setInterval = workerTimers.setInterval; This includes library's such as jQuery as otherwise timed events such as fadeOut and fadeIn will break.
window.clearInterval = workerTimers.clearInterval;
window.setTimeout = workerTimers.setTimeout; # NPM
window.clearTimeout = workerTimers.clearTimeout; 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"
]
}
}
``` ```

View File

@ -1,14 +1,11 @@
{ {
"name": "hacktimer", "name": "hacktimer",
"version": "1.1.0", "version": "1.1.3",
"description": "Avoid timers throttling by browser when tab is inactive", "description": "Avoid timers throttling by browser when tab is inactive",
"main": "HackTimer.js", "main": "HackTimer.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/turuslan/HackTimer.git" "url": "git+https://github.com/ctubio/HackTimer.git"
}, },
"keywords": [ "keywords": [
"suspend", "suspend",
@ -25,7 +22,7 @@
"author": "turuslan <turuslan.devbox@gmail.com> (http://github.com/turuslan/)", "author": "turuslan <turuslan.devbox@gmail.com> (http://github.com/turuslan/)",
"license": "MIT", "license": "MIT",
"bugs": { "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"
} }