<!-- Visual Studio Browser Link --> <scrip{filter}t type="application/json" id="__browserLink_initializationData"> {"appName":"Chrome","requestId":"c1d966c4e30a4503926d28e76b7bc5be"} </scrip{filter}t> <scrip{filter}t type="text/javascrip{filter}t" src="http://localhost:33888/4162501dbbc24a0fb1ec87e6027ba41e/browserLink" async="async"></scrip{filter}t> <!-- End Browser Link -->
Today I wrote a project, and I used a Pace.js page progress loading plugin in the project, and found that the page loading progress bar was very slow and always did not load.
Finally, find the reason, why? I found a few more lines of door-to-door code in the source code, what the hell? ?
What is Browser Link?
The function of this Browser Link is to build a communication bridge between the flow and the Visual Studio IDE through a script file, and after enabling Browser Link, Visual Studio will inject an IHttpModule module object into the website, and then register a script on each page.
The Browser Link feature is implemented using SignalR technology.
With all that said, what exactly is the Browser Link function used for?
Now the Broswer Link function is relatively simple, it is used to refresh the page that has been opened in the browser in the Visual Studio IDE, why refresh the page in the Visual Studio IDE?
If you are developing a page that needs to be compatible with IE, GOOGLE, FIREFOX and mobile browsers, you may use these flowers to open your page at the same time, if you find some kind of problem, go back to VS IDE to modify it, and after the modification, you can click "Refresh Linked Browsers" in the Visual Studio IDE to refresh all browsers to see the effect.
Now this "Browser Link" only has such a refresh function, but the Browser Link function can be written as an extension function, and you can customize some of the functions you need.
If you don't want to use this feature, just add the following code under the appSettings node in web.config.
<appSettings> <add key="webpages:Version" value="2.0.0.0" /> <add key="webpages:Enabled" value="false" /> <add key="PreserveLoginUrl" value="true" /> <add key="ClientValidationEnabled" value="true" /> <add key="UnobtrusiveJavascrip{filter}tEnabled" value="true" />
<add key="vs:EnableBrowserLink" value="false"/> </appSettings>
The red one is to be added, and finally, it is perfectly solved!!
|