Skip to content

Commit ac09cce

Browse files
committed
open-in-pdf-reader for edge
1 parent 84a9111 commit ac09cce

File tree

3 files changed

+72
-70
lines changed

3 files changed

+72
-70
lines changed

config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ exports.ids = {
4343
'khgbdhkpcapllhgfekjegcinegfhjbmi', // YVAD by (Opera) [By @InBasic]
4444
'cehiomcamjpnfmemkmpjadaclohoibgo', // Open in PDF viewer (Chrome)
4545
'honagjpkinogkppkapphkpdffnegagge', // Open in PDF viewer (Opera)
46+
'ciphgjdgpkhlngiadnpebblpcjcoabcp', // Open in PDF viewer (Edge)
4647
'nfpgfobeckckemhmggkdfjkjaiikadnd', // Open in Yandex (Chrome)
4748
'dlobcokaeaiaihfebfhpdoongldphgkf', // Open in Yandex (Opera)
4849
'bffjckjhidlcnenenacdahhpbacpgapo', // Country Flags (Chrome)
@@ -62,6 +63,7 @@ exports.ids = {
6263
'mgmnomlncpmfgelhofilonnecmbdaoia', // Open in Brave (Chrome) [By @brian-girko]
6364
'pfenoignchfmjmphnpfihgockdhejcjf', // Open in Sumatra (Chrome)
6465
'ojmcfmboidiokgkgmilnmjnjkdbgakpn', // Open in Sumatra (Opera)
66+
'alighchillgifpgaigbgnmhnndoecalj', // TESSST
6567
],
6668
firefox: [
6769
'{b8fa78dd-dae1-4839-9d0e-ce5e213083ce}', // Open in GIMP

host.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ let files = [];
2020
const sprocess = [];
2121

2222
const config = {
23-
version: '0.8.8'
23+
version: '0.8.9'
2424
};
2525
// closing node when parent process is killed
2626
process.stdin.resume();

messaging.js

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -7,119 +7,119 @@
77
// - Transform - transform message objects to reply objects
88
// - Debug - transform JavaScript objects to lines of JSON (for debugging, obviously)
99

10-
var stream = require('stream');
11-
var util = require('util');
10+
const stream = require('stream');
11+
const util = require('util');
1212

1313
function Input() {
14-
stream.Transform.call(this);
14+
stream.Transform.call(this);
1515

16-
// Transform bytes...
17-
this._writableState.objectMode = false;
18-
// ...into objects.
19-
this._readableState.objectMode = true;
16+
// Transform bytes...
17+
this._writableState.objectMode = false;
18+
// ...into objects.
19+
this._readableState.objectMode = true;
2020

21-
// Unparsed data.
22-
this.buf = new Buffer(0);
23-
// Parsed length.
24-
this.len = null;
21+
// Unparsed data.
22+
this.buf = Buffer.alloc(0);
23+
// Parsed length.
24+
this.len = null;
2525
}
2626

2727
util.inherits(Input, stream.Transform);
2828

2929
Input.prototype._transform = function(chunk, encoding, done) {
30-
// Save this chunk.
31-
this.buf = Buffer.concat([ this.buf, chunk ]);
32-
33-
var self = this;
34-
35-
function parseBuf() {
36-
// Do we have a length yet?
37-
if (typeof self.len !== 'number') {
38-
// Nope. Do we have enough bytes for the length?
39-
if (self.buf.length >= 4) {
40-
// Yep. Parse the bytes.
41-
self.len = self.buf.readUInt32LE(0);
42-
// Remove the length bytes from the buffer.
43-
self.buf = self.buf.slice(4);
44-
}
45-
}
46-
47-
// Do we have a length yet? (We may have just parsed it.)
48-
if (typeof self.len === 'number') {
49-
// Yep. Do we have enough bytes for the message?
50-
if (self.buf.length >= self.len) {
51-
// Yep. Slice off the bytes we need.
52-
var message = self.buf.slice(0, self.len);
53-
// Remove the bytes for the message from the buffer.
54-
self.buf = self.buf.slice(self.len);
55-
// Clear the length so we know we need to parse it again.
56-
self.len = null;
57-
// Parse the message bytes.
58-
var obj = JSON.parse(message.toString());
59-
// Enqueue it for reading.
60-
self.push(obj);
61-
// We could have more messages in the buffer so check again.
62-
parseBuf();
63-
}
64-
}
30+
// Save this chunk.
31+
this.buf = Buffer.concat([this.buf, chunk]);
32+
33+
const self = this;
34+
35+
function parseBuf() {
36+
// Do we have a length yet?
37+
if (typeof self.len !== 'number') {
38+
// Nope. Do we have enough bytes for the length?
39+
if (self.buf.length >= 4) {
40+
// Yep. Parse the bytes.
41+
self.len = self.buf.readUInt32LE(0);
42+
// Remove the length bytes from the buffer.
43+
self.buf = self.buf.slice(4);
44+
}
6545
}
6646

67-
// Check for a parsable buffer (both length and message).
68-
parseBuf();
47+
// Do we have a length yet? (We may have just parsed it.)
48+
if (typeof self.len === 'number') {
49+
// Yep. Do we have enough bytes for the message?
50+
if (self.buf.length >= self.len) {
51+
// Yep. Slice off the bytes we need.
52+
const message = self.buf.slice(0, self.len);
53+
// Remove the bytes for the message from the buffer.
54+
self.buf = self.buf.slice(self.len);
55+
// Clear the length so we know we need to parse it again.
56+
self.len = null;
57+
// Parse the message bytes.
58+
const obj = JSON.parse(message.toString());
59+
// Enqueue it for reading.
60+
self.push(obj);
61+
// We could have more messages in the buffer so check again.
62+
parseBuf();
63+
}
64+
}
65+
}
66+
67+
// Check for a parsable buffer (both length and message).
68+
parseBuf();
6969

70-
// We're done.
71-
done();
70+
// We're done.
71+
done();
7272
};
7373

7474
function Output() {
75-
stream.Transform.call(this);
75+
stream.Transform.call(this);
7676

77-
this._writableState.objectMode = true;
78-
this._readableState.objectMode = false;
77+
this._writableState.objectMode = true;
78+
this._readableState.objectMode = false;
7979
}
8080

8181
util.inherits(Output, stream.Transform);
8282

8383
Output.prototype._transform = function(chunk, encoding, done) {
84-
var len = new Buffer(4);
85-
var buf = new Buffer(JSON.stringify(chunk));
84+
const len = Buffer.alloc(4);
85+
const buf = new Buffer(JSON.stringify(chunk));
8686

87-
len.writeUInt32LE(buf.length, 0);
87+
len.writeUInt32LE(buf.length, 0);
8888

89-
this.push(len);
90-
this.push(buf);
89+
this.push(len);
90+
this.push(buf);
9191

92-
done();
92+
done();
9393
};
9494

9595
function Transform(handler) {
96-
stream.Transform.call(this);
96+
stream.Transform.call(this);
9797

98-
this._writableState.objectMode = true;
99-
this._readableState.objectMode = true;
98+
this._writableState.objectMode = true;
99+
this._readableState.objectMode = true;
100100

101-
this.handler = handler;
101+
this.handler = handler;
102102
}
103103

104104
util.inherits(Transform, stream.Transform);
105105

106106
Transform.prototype._transform = function(msg, encoding, done) {
107-
this.handler(msg, this.push.bind(this), done);
107+
this.handler(msg, this.push.bind(this), done);
108108
};
109109

110110
function Debug() {
111-
stream.Transform.call(this);
111+
stream.Transform.call(this);
112112

113-
this._writableState.objectMode = true;
114-
this._readableState.objectMode = false;
113+
this._writableState.objectMode = true;
114+
this._readableState.objectMode = false;
115115
}
116116

117117
util.inherits(Debug, stream.Transform);
118118

119119
Debug.prototype._transform = function(chunk, encoding, done) {
120-
this.push(JSON.stringify(chunk) + '\n');
120+
this.push(JSON.stringify(chunk) + '\n');
121121

122-
done();
122+
done();
123123
};
124124

125125
exports.Input = Input;

0 commit comments

Comments
 (0)