Is it possible to overwrite [removed] function with a custom function?

后端 未结 2 1899
隐瞒了意图╮
隐瞒了意图╮ 2021-01-02 03:32

Is it possible to disable, or even better, replace with a custom function, window.location?

This question is related: Disable a built-in function in jav

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-02 04:13

    try this

    var _window = {
           location: "myLocation"
    };
    
    (function (window) {
       console.log(window.location);
    }(_window));
    

提交回复
热议问题