Modifying / Patching Chromium Source


What I want to do?

  1. Embed symmetric keys into Chromium source code such that on typing “window.key” in JS i get the embedded key.
  2. Create a code integrity checker into the Browser itself which will run at app start.

Why I am doing this?

  1. To enhance JS code security in electron apps.

What I need?

  1. Is this possible?
    1.1. If Yes (NOTE: I am a not familiar with chromium source code)
    1.1.1. Which part of the chromium code needs to be modified for achieving the objectives?
    1.1.2. If you are referring to patching stuff then please give links or guides.
    1.1.3. Anyone willing to advice me further or wants to team up just leave a comment. (Apart from general comments)
    1.2 Else If No
    1.2.1. That’s not possible
    1.3. Else
    1.3.1. Yes I am aware of methods in which we use keys like auth tokens from servers.

Whats with the question structure?
I just wanted to layout things as clearly as possible.