Note that the chrome plug-in is used to modify the responseHeaders of all websites.

Source: Internet
Author: User

Note that the chrome plug-in is used to modify the responseHeaders of all websites.

1 currently, the debugging skills I have mastered are very inconvenient. Now I am using browser actions. I need to click the pop-up page every time and right-click and view the elements to display the debugging panel. when you click a location, it does not exist;

2. When modifying the response header value, the network Panel of the debugging tool on the webpage will not change. That is to say, it cannot be reported, but it is found that in actual use, changes have taken place. The output value in the debugging Panel of the popup plug-in can also be seen as changed, which is depressing;

3 For example, for the onHeadersReceived event, the default details parameter does not contain the responseHeaders attribute. If you need to add it to the third parameter of addListener, this parameter cannot be garbled, if it is garbled, it will output a js error prompt on the popup debugging panel, saying that this parameter only allows any parameters for this on event. if I add a ["responseHeadersd", "blocking"] randomly, it will prompt as follows: Uncaught Error: Invalid value for argument 2. property '. 0': Value must be one of: [blocking, responseHeaders]. because I write another d, if you don't understand what parameters can be accepted here, You can intentionally write an error to let you know what it can use,


, You can see that it can open two debugging panels, one is the popup and the other is the current page; if you modify the code, directly f5 the popup debugger will load, you do not need to go back to plug-in management. Press ctrl _ + r.



4. Add a head that allows all domain name cross-origin requests to all response URLs. For example, you want to test some js functions. cross-origin requests are used, but it is not convenient to modify the data of the other party. In this case, you can use this plug-in to process the data. let the browser treat the content of its domain name as your own.

Chrome. webRequest. onHeadersReceived. addListener (function (details ){
Details. responseHeaders. push ({name: 'Access-Control-Allow-origin', value :"*"});
Console. log (details. responseHeaders)
Return {responseHeaders: details. responseHeaders };
},{ Urls: ["<all_urls>"]}, ["responseHeaders", "blocking"]);


Next, let's take a look at the content returned by Baidu processed by using this plug-in. You can use this plug-in at will and no longer output errors without cross-domain permissions.




Ask chrome fans about the installation of chrome browser plug-ins: "are plug-ins allowed to browse user data on all websites?" Why?

For privacy-sensitive users, the choice of third-party plug-ins should be careful, but the plug-ins you can find in google extensions are basically safe ,, choose plug-ins of the same type with high installation volume and high praise as much as possible, so as to ensure the confidentiality and security of your personal information.

Search for a Google Chrome browser plug-in with the same effect as Firefox's Modify Headers plug-in;

I have checked it carefully and want to use it, but it is certainly not yet. Because it is relatively new, I have read its official website blog on Firefox, you have been fixing plug-ins and fixing bugs. You still need to wait.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.