I think this is not possible, because Selenium is actually an adapter for several implementations. Therefore, it cannot refuse to load some scripts in firefox or chrome. Perhaps you can check the api driver (firefox profile, htmlunit configuration file) to accomplish this.
source share