As some js files are very common and widely used on the web, why browsers don't reutilise them?
wouldn't it improve efficiency, as js framework files are usually heavy?
Obviously though you are now using google' bandwidth to download that file. Although the overall bandwidth used amongst all websites is less that if each one hosted the same file. Google is paying for more of it.
But generally, if you have published a JS framework of some kind, it would cost you money to host the file in a hot linkable way.
One reason is that there is no web of trust in place that would facilitate using code from one source in the rendering of a website from another source. Right now all the code linked in a HTML document is (supposed to) running in a sandbox where it pretty much only access data and functions related to that document and some things about the browser.
What you don't want is that module
superawesomecompany.com is used widely on the net by various other sites due to its utility, but then it turns out that they secretly phone home all your credentials. If you include the actual code to run in each website, you can at least be sure no sudden changes are snuck in. If you just
import leftpad in your code and the code is dynamically loaded at runtime, you can only trust in
superawesomecompany and hope they're not evil.
If your site not only depends on your server, but N other servers, you have N additional bottle necks, possible break points, especially if some library becomes popular. Their servers are not necessarily very commercial. They might even blacklist such an abuse of their resources.
Also you do not want to give them statistics and other info on your site.
And hackers then have fruitfull access points for attacks. In the past some PHP frameworks (as PHP was/is popular) had such backdoors.