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"; const appName = "com.chatterino.chatterino";
let port;
function matchUrl(url) { function matchUrl(url) {
if (!url) if (!url)
return; return;
@ -25,24 +27,21 @@ 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) { port.onMessage.addListener(function(msg) {
console.log(msg); console.log(msg);
}); });
port.onDisconnect.addListener(function() { port.onDisconnect.addListener(function() {
console.log("Disconnected"); console.log("Disconnected");
}); });
port.postMessage({ text: "Hello, my_application" }); }
function selectChannel(channelName) { function selectChannel(channelName) {
console.log(channelName); console.log(channelName);
port.postMessage({channelName: channelName}); port.postMessage({channelName: channelName});
// chrome.runtime.sendNativeMessage(appName, { "xd": true }, (resp) => {
// console.log(resp);
// })
} }
/// add listeners /// add listeners

View file

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