Files
PageSigner/ui/RawViewer.js
themighty1 79173c511e - use Salsa20 instead of tweetnacl-js's secretbox for a 30% garbling speedup in the browser.
- implement garbled row reduction GRR3 for 25% bandwidth saving
- implement KOS15 OT extension
- linting
2022-01-17 10:18:04 +03:00

31 lines
947 B
JavaScript

/* global chrome*/
import {decode_str} from './utils.js';
class RawViewer{
constructor(){
window.tabid = null; // allow the extension to put the id of the tab which opened this page
window.isRawViewer = true;
// isReady will be se to true after message listener is installed
window.isReady = false;
}
main(){
chrome.runtime.onMessage.addListener(function(obj) {
if (obj.destination !== 'rawviewer') return;
console.log('got obj', obj);
if (obj.tabId != window.tabid) return;
const request = decode_str(obj.data.request);
const response = decode_str(obj.data.response);
document.getElementById('request').textContent = request;
document.getElementById('response').textContent = response;
document.getElementById('notarization_time').textContent = obj.data.sessionId;
});
window.isReady = true;
}
}
window.rawViewer = new RawViewer();
window.rawViewer.main();