I am not asking a question because I finally solved it, but I will publish it since I spent more han 3 hours trying to figure it out.
SITUATION
I am developing a Chrome Extension and want to allow the user to change Chrome settings through the "options.html" page.
The extension loads the Current Configuration as an Object options.js
:
let myConfiguration = new Object()
myConfiguration = getCurrentConfig()
If I call my variable myConfiguration
within my options.js
, I get an empty Object:
console.log(myConfiguration)
// Output: {}
If I call my variable from devtools I get the Object:
console.log(myConfiguration)
// Output: {key1: value1, key2: value2,...}
This drove me nuts. See answer below.