summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Timing.js4
-rw-r--r--src/lib/log.js4
2 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/Timing.js b/src/lib/Timing.js
index 997ebd3..dd4fa06 100644
--- a/src/lib/Timing.js
+++ b/src/lib/Timing.js
@@ -15,7 +15,7 @@ class Timing {
}
async pause() {
- if (this.interrupted) throw new TimingException("Interrupted");
+ if (this.interrupted) throw new TimingException("Timing: interrupted");
let now = Date.now();
this.calls++;
let sinceLastCall = now - this.lastCall;
@@ -28,7 +28,7 @@ class Timing {
if (now - this.lastPause > this.workSlot || this.calls > this.maxCalls) {
this.tooLong = this.elapsed >= this.longTime;
if (this.tooLong && this.fatalTimeout) {
- throw new TimingException(`Exceeded ${this.longTime}ms timeout`);
+ throw new TimingException(`Timing: exceeded ${this.longTime}ms timeout`);
}
this.calls = 0;
await Timing.sleep(this.pauseTime);
diff --git a/src/lib/log.js b/src/lib/log.js
index f548c49..a30a5a6 100644
--- a/src/lib/log.js
+++ b/src/lib/log.js
@@ -1,6 +1,8 @@
{
- let PREFIX = `[${browser.runtime.getManifest().name}]`;
+ let PREFIX = typeof browser === "object"
+ ? `[${browser.runtime.getManifest().name}]` : '';
+
let debugCount = 0;
function log(msg, ...rest) {