Chrome.send is not available for electron/pdf-viewer


#1

Uncaught ReferenceError: chrome is not defined
at Object.sendWithPromise (cr.js:369)
at main.js:45
at main.js:52

which use function defined in cr.js

  function sendWithPromise(methodName, var_args) {
      var args = Array.prototype.slice.call(arguments, 1);
      var promiseResolver = new PromiseResolver();
      var id = methodName + '_' + createUid();
      chromeSendResolverMap[id] = promiseResolver;
      chrome.send(methodName, [id].concat(args));
      return promiseResolver.promise;
  }