(This is a follow-up question from here.)
From the Metamask developers faq it is stated to "bundle the version of web3 that is used during development".
So I downloaded a web3.min.js version 0.20.6 from GitHub and "bundled" it like in the code below. Then I log "web3.version.api" to the console.
Now, with or without the bundling, the console reports a version 0.20.3 after clicking the button.
I suspect this is due to the line
web3 = new Web3(web3.currentProvider);
which sets web3 to the injected code from my Metamask plugin, in which I am logged in, and it runs that code, not my "bundled" version ...
Question: How do I bundle my own version of web3?
PS. I created the button to make sure the web3 call to "web.version.api" is done "outside adding the eventListener to window" as per the suggestion of @Kai Kälberer
Update: As suggested by @viz I downloaded the non-minified web3j version from GitHub and uncommented the line that avoids overriding the global web3 instance. Check this screenshot from my dev tools debugger:
Still I see that the console prints out the version 0.20.3 and not 0.20.6 as defined in the downloaded web3.js ... why?