included namespace define as well

This commit is contained in:
fourtf 2018-04-12 00:40:18 +02:00
parent accb88b78e
commit 20596ddccd
2 changed files with 13 additions and 14 deletions

View file

@ -10,6 +10,8 @@ const ignoredPages = {
const appName = "com.chatterino.chatterino";
let port;
function matchUrl(url) {
if (!url)
return;
@ -25,7 +27,8 @@ function matchUrl(url) {
}
}
var port = chrome.runtime.connectNative("com.chatterino.chatterino");
function connectPort() {
let port = chrome.runtime.connectNative("com.chatterino.chatterino");
port.onMessage.addListener(function(msg) {
console.log(msg);
@ -33,16 +36,12 @@ port.onMessage.addListener(function(msg) {
port.onDisconnect.addListener(function() {
console.log("Disconnected");
});
port.postMessage({ text: "Hello, my_application" });
}
function selectChannel(channelName) {
console.log(channelName);
port.postMessage({channelName: channelName});
// chrome.runtime.sendNativeMessage(appName, { "xd": true }, (resp) => {
// console.log(resp);
// })
}
/// add listeners

View file

@ -10,6 +10,8 @@
#ifdef BOOSTLIBS
#include <boost/interprocess/ipc/message_queue.hpp>
namespace ipc = boost::interprocess;
#endif
#ifdef Q_OS_WIN
@ -21,8 +23,6 @@
#define EXTENSION_ID "aeicjepmjkgmbeohnchmpfjbpchogmjn"
#define MESSAGE_SIZE 1024
namespace ipc = boost::interprocess;
namespace chatterino {
namespace singletons {