mirror of
https://github.com/nfstream/nfstream.git
synced 2026-05-02 00:40:06 +00:00
Introduce system visibility feature.
This commit is contained in:
parent
0ee3ffdf1a
commit
729e69d97b
22 changed files with 5 additions and 5 deletions
37
browser/chrome/nfstream.js
Normal file
37
browser/chrome/nfstream.js
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/*
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
nfstream.js
|
||||
Copyright (C) 2019-21 - NFStream Developers
|
||||
This file is part of NFStream, a Flexible Network Data Analysis Framework (https://www.nfstream.org/).
|
||||
NFStream is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
|
||||
version.
|
||||
NFStream is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
|
||||
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
||||
You should have received a copy of the GNU Lesser General Public License along with NFStream.
|
||||
If not, see <http://www.gnu.org/licenses/>.
|
||||
------------------------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
var success_count = 0;
|
||||
var error_count = 0;
|
||||
|
||||
function upload_to_nfstream(msg) {
|
||||
chrome.storage.local.get({export_port: '28314'},
|
||||
function (items) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
var uid = "nfstream-" + msg.browser + "-" + msg.tab_id + "-" + msg.req_id + ".json";
|
||||
try {
|
||||
xhr.open("POST",
|
||||
"http://localhost:" + items.export_port + "/" + uid,
|
||||
true);
|
||||
xhr.setRequestHeader("Content-type", "application/json");
|
||||
xhr.send(JSON.stringify(msg));
|
||||
success_count++;
|
||||
} catch (e) {
|
||||
error_count++;
|
||||
}});
|
||||
}
|
||||
|
||||
|
||||
chrome.runtime.onMessage.addListener(upload_to_nfstream);
|
||||
Loading…
Add table
Add a link
Reference in a new issue