Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Seeing JavaScript errors in developer tools on each page #14890

Closed
bsclifton opened this issue Aug 1, 2018 · 3 comments · Fixed by #14896
Closed

Seeing JavaScript errors in developer tools on each page #14890

bsclifton opened this issue Aug 1, 2018 · 3 comments · Fixed by #14896

Comments

@bsclifton
Copy link
Member

bsclifton commented Aug 1, 2018

Reported by @snyderp

Description

When opening the developer tools on any page (the content developer tools), you'll notice a lot of JavaScript errors

Steps to Reproduce

  1. Visit https://brave.com
  2. Open developer tools
  3. View console

Actual result:

screen shot 2018-07-31 at 11 23 10 pm

Uncaught ReferenceError: require is not defined
    at adInsertion.js:5
pageInformation.js:159 error resolving rule at position #0
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #1
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #2
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #3
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #4
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #5
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #6
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #7
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #8
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #9
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #10
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #11
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #12
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #13
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #14
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #15
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #16
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #17
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)
chrome.ipcRenderer.once @ pageInformation.js:159
pageInformation.js:159 error resolving rule at position #18
 Error: invalid expression
    at resolve (pageInformation.js:119)
    at EventEmitter.chrome.ipcRenderer.once (pageInformation.js:157)
    at Object.onceWrapper (VM66 extensions::event_emitter:292)
    at emitTwo (VM66 extensions::event_emitter:105)
    at EventEmitter.emit (VM66 extensions::event_emitter:193)
    at EventEmitter.ipcRenderer.emit (VM65 extensions::ipc_utils:35)

Expected result:
no JavaScript errors

Reproduces how often:

100%

Brave Version

about:brave info:

Reproducible on current live release:

Additional Information

Brave: 0.23.73
V8: 6.8.275.24
rev: 50bdb6d
Muon: 8.0.3
OS Release: 17.7.0
Update Channel: Release
OS Architecture: x64
OS Platform: macOS
Node.js: 7.9.0
Brave Sync: v1.4.2
libchromiumcontent: 68.0.3440.75

@bsclifton
Copy link
Member Author

bsclifton commented Aug 1, 2018

caused by #14851

The content scripts don't have access to require()
image

cc: @riastradh-brave

@bsclifton bsclifton self-assigned this Aug 1, 2018
riastradh-brave added a commit that referenced this issue Aug 1, 2018
Use Math.floor(n*Math.random()) instead of crypto.random.uniform(n)
because this doesn't obviously seem to be security-related, if it is
used at all.

fix #14890

Auditors: @bsclifton

Test Plan:
1. do anything, check javascript console for errors
@bsclifton bsclifton reopened this Aug 1, 2018
@NejcZdovc NejcZdovc assigned NejcZdovc and unassigned bsclifton Aug 1, 2018
@bsclifton
Copy link
Member Author

Re-opening since the main cause of these issues is with the ledger (messages.LEDGER_PUBLISHER_RESPONSE ipc message). Caused by #14751

@LaurenWags
Copy link
Member

LaurenWags commented Aug 2, 2018

Verified with macOS 10.12.6 using

  • 0.23.74 b508fa7
  • Muon 8.0.4
  • libchromiumcontent 68.0.3440.84

Verified on Windows 10 x64 using

  • 0.23.77 0125b5f
  • Muon 8.0.6
  • libchromiumcontent 68.0.3440.84
    @bsclifton there seems to be extra logging info on console which might need to be turned off
    image

Verified on Ubuntu 17.10 x64

  • 0.23.77 0125b5f
  • Muon 8.0.6
  • libchromiumcontent 68.0.3440.84

pull bot pushed a commit to security-geeks/browser-laptop that referenced this issue Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.