contentRouting.findProviders
real browser dht network network size 60 kbucket 20 maxPeers 40 randomWalk off visible connection churn due to maxPeers
_then = Promise.prototype.then | |
// [Function: then] | |
Promise.prototype.then = function(){ console.log('then!'); return _then.apply(this, arguments); } | |
// [Function (anonymous)] | |
p = new Promise(resolve => resolve()) | |
// Promise { undefined } |
const provider = polyfillJsonRpcBatchAsBatchTx(inpageProvider) | |
function polyfillJsonRpcBatchAsBatchTx (oldProvider) { | |
const newProvider = { sendAsync } | |
return newProvider | |
function sendAsync (req, cb) { | |
if (Array.isArray(req)) { |
"use strict" | |
const { Membrane } = require('es-membrane') | |
// create raw object to be protected by membrane | |
const rawObj = { secure: true } | |
// create membrane to manage interaction | |
const membrane = new Membrane() |
const { Membrane } = require('es-membrane') | |
const { defineModule, getRawModule } = createModuleSystem() | |
// | |
// define modules | |
// | |
// module X | |
defineModule('x', (require) => { |
// // Called when the user clicks on the browser action. | |
// chrome.action.onClicked.addListener(function(tab) { | |
// // No tabs or host permissions needed! | |
// console.log('Turning ' + tab.url + ' red!'); | |
// // chrome.tabs.executeScript({ | |
// // code: 'document.body.style.backgroundColor="red"' | |
// // }); | |
// }); |
const test = require('tape-promise').default(require('tape')) | |
const SES = require('../lib/ses.umd.js') | |
const realm = SES.makeSESRootRealm() | |
test(async t => { | |
const globalStore = {} | |
runModuleA() |
const client = Raven.config(ravenTarget, { | |
release, | |
transport: function(opts) { | |
// modify report urls | |
const report = opts.data | |
rewriteReportUrls(report) | |
// make request normally | |
client._makeRequest(opts) | |
} | |
}) |