-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Jonny edited this page Jun 1, 2019
·
15 revisions
Just some notes to help you get started.
There are two parts to this application, the client extension and the server. The extension is located in the extension/
subdirectory, and the server is located mainly in server.js
, importing some other files from shared/
.
The extension begins with ldn.js
. This is the background page of the Chrome extension.
constructor() {
this.user = new User();
this.ws = null;
this.tabListener = new TabListener();
chrome.runtime.onMessage.addListener((msg, sender, sendResponse) =>
this._onRuntimeMessage(msg, sender, sendResponse)
);
console.log('<LDN> LDN has been started!');
}
Some things about ldn.js
:
- keeps a local variable user which is just a model that I use to hold user data
- keeps a local ws reference to the websocket client
- tabListener listens to tab events to inject
loader.js
into the Netflix watch page (a viewing page) -
loader.js
is a script that injectscontroller.js
into the DOM
The server begins with server.js
. A simple WebSocket server, it keeps a map of lobbies and sockets.