this.name = '';
this.age = 0;
this.year = 0;
// ...
for (var x in options) {
if (options.hasOwnProperty(x)) {
this[x] = options[x];
}
}
this.name = '';
this.age = 0;
this.year = 0;
var availableOptions = ['name', 'age', 'year'];
// ...
for (var i = 0; i < availableOptions.length; i ++) {
var x = availableOptions[i];
if (options.hasOwnProperty(x)) {
this[x] = options[x];
}
}
chrome.webNavigation.onDOMContentLoaded.addListener(function (details) {
if (details.frameId == 0) {
chrome.tabs.executeScript(details.tabId, {
runAt:'document_start',
file: 'script.js'
});
}
})
var el = document.createElement('div');
el.innerText = "Hell world!";
document.body.appendChild(el);