JavaScript completely "tamper safe" variables

Viewed 289

So, here is the issue.

I have something like:

// Dangerous __hostObject that makes requests bypassing 
// the same-origin policy exposed from other code.
(function(){
    var danger = __hostObject;
})();
delete __hostOBject;

Am I perfectly safe knowing no script can tamper or access __hostObject?

( If they can, I have an CSRF vulnerability or worse. )

Note 1: This is for a browser extension. I have better hooks than other scripts running on the page. I execute before them and I'm done before they've even loaded.

Note 2: I know this has been asked multiple times for scripts in general. I'm wondering if it's possible if I know I load before any other scripts.

2 Answers
Related