更改window.navigator JavaScript

时间:2013-01-02 15:47:00

标签: javascript arrays browser

我试图更改window.navigator。但由于某种原因无法改变它:

--
[10:40:28.802] window.navigator['buildID'];
[10:40:28.811] "20121129162756"
--
[10:40:47.225] window.navigator['appCodeName'] = "I want to change it";
[10:40:47.234] "I want to change it"
--
[10:40:55.633] window.navigator['appCodeName'];
[10:40:55.643] "Mozilla"
--
[10:41:02.405] window.navigator['myProperty'] = 'someproperty';
[10:41:02.414] "someproperty"
--
[10:41:07.651] window.navigator['myProperty'];
[10:41:07.660] "someproperty"

希望我的问题很明确:'如何更改window.navigator?'

1 个答案:

答案 0 :(得分:3)

你做不到。它预先存在的属性是只读的。你想要修改它的原因超出了我的范围......