Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .bowerrc

This file was deleted.

50 changes: 0 additions & 50 deletions .firebase/hosting.d2Vic2l0ZQ.cache

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ temp
.tmp
.firebase
dist
notes
.sass-cache
app/bower_components
website
Expand Down
6 changes: 0 additions & 6 deletions .yo-rc.json

This file was deleted.

14 changes: 14 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Requires npm and gulp to build

Versions used to build v1.0.0 of Internet Friends:

npm v8.4.1
gulp CLI v2.3.0
gulp Local v4.0.2

To build:

1) cd to the root directory
2) run 'npm install'
3) run 'gulp'
4) run 'gulp package'
15 changes: 0 additions & 15 deletions app/extension/html/background.html

This file was deleted.

2 changes: 1 addition & 1 deletion app/extension/html/iframe/chat.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src="../../scripts/logger.js"></script>
<script src="../../scripts/settings.js"></script>
<script src="../../scripts/portManager.js"></script>
<script src="../../scripts/chat.js"></script>
<script src="../../scripts/bundle.js"></script>
<title>Internet Friends</title>
</head>
<body>
Expand Down
170 changes: 0 additions & 170 deletions app/extension/scripts/backgroundPortManager.js

This file was deleted.

36 changes: 19 additions & 17 deletions app/extension/scripts/portManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,9 @@ var portManager = function (source, messageCallback, disconnectCallback){
_messageListener = messageCallback;
_disconnectListener = disconnectCallback;

// receive messages from "background.js"
_port = chrome.runtime.connect({name: "InternetFriends-" + source});
_port.onMessage.addListener(port_onMessage);
_port.onDisconnect.addListener(port_onDisconnect);

Logger.log(`PortManager Initialized in "${source}"`);
};

// private functions --------------------------------------------------------

// events -------------------------------------------------------------------
function port_onMessage (message){
// call the listener callback
if (_messageListener) _messageListener(message);
};

function port_onDisconnect (){
if (_disconnectListener) _disconnectListener();
};

// public functions ---------------------------------------------------------
_this.tell = function (event, data){
var data = data || {};
Expand All @@ -43,6 +26,25 @@ var portManager = function (source, messageCallback, disconnectCallback){
});
}
};

_this.connect = function () {
Logger.log("Connecting to Background Script...");

_port = chrome.runtime.connect({name: "InternetFriends-" + source});

if (_messageListener) _port.onMessage.addListener(_messageListener);
if (_disconnectListener) _port.onDisconnect.addListener(_disconnectListener);
}

_this.disconnect = function () {
if (!_port)
return;

Logger.log("Disconnecting from Background Script...");

_port.disconnect();
_port = null;
}

// messages -----------------------------------------------------------------
_this.init(source, messageCallback, disconnectCallback);
Expand Down
38 changes: 21 additions & 17 deletions app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"name": "__MSG_appName__",
"version": "1.0.0",
"manifest_version": 2,
"version": "1.1.1",
"manifest_version": 3,
"description": "__MSG_appDescription__",
"icons": {
"16": "images/icon-16.png",
"128": "images/icon-128.png"
},
"default_locale": "en",
"incognito": "split",
"background": {
"page": "html/background.html"
"service_worker": "scripts/background.js"
},
"permissions": [
"storage",
"activeTab"
"activeTab",
"tabs"
],
"content_scripts": [{
"matches": [
Expand Down Expand Up @@ -42,19 +42,23 @@
"run_at": "document_start"
}],
"web_accessible_resources": [
"scripts/logger.js",
"scripts/settings.js",
"scripts/backgroundPortManager.js",
"scripts/bundle.js",
"scripts/popup.js",
"html/iframe/chat.html",
"scripts/chat.js",
"styles/core.css",
"styles/chat.css",
"styles/slider.css",
"styles/popup.css"
{
"resources": [
"scripts/logger.js",
"scripts/settings.js",
"scripts/background.js",
"scripts/popup.js",
"html/iframe/chat.html",
"scripts/bundle.js",
"styles/core.css",
"styles/chat.css",
"styles/slider.css",
"styles/popup.css"
],
"matches": ["*://*/*"]
}
],
"browser_action": {
"action": {
"default_popup": "html/popup.html",
"default_icon": {
"19": "images/icon-19.png",
Expand Down
Loading