Giter Site home page Giter Site logo

ygyooo / ajax-interceptor Goto Github PK

View Code? Open in Web Editor NEW
877.0 13.0 249.0 17.22 MB

A chrome extension to modify the response of ajax requests. 修改ajax请求返回结果的chrome插件

Home Page: https://chrome.google.com/webstore/detail/ajax-interceptor/nhpjggchkhnlbgdfcbgpdpkifemomkpg

JavaScript 89.69% HTML 2.16% Less 8.15%

ajax-interceptor's Introduction

English | 简体中文

A chrome extension for modifing any ajax requests or responses easily. You can use it to debug errors or mock data.

Install

https://chrome.google.com/webstore/detail/ajax-interceptor/nhpjggchkhnlbgdfcbgpdpkifemomkpg

Example

Example video:https://www.youtube.com/watch?v=OL87EPOEVIU

Notes

  1. It is recommended to disable cache(devtools -> network -> disable cache) image when using this chrome extension.
  2. It is recommended to turn off this extensionimage when you are not using it.
  3. This extension only overrides the response data in the XMLHTTPRequest object as well as the fetch method. The "original" response which you can see in DevTools' "Network" panel will not be changed.

Release Notes

version 1.5.3:

  • add request url autofill to fix matching issues

version 1.5.2:

  • fix not intercepting in the onload situation

version 1.5.1:

  • add advanced modes for users to encode and modify request headers, request payloads, and responses
  • support responses with the non-200 status
  • add strong tips to remind users of settings related to the devtools
  • optimize the user interface

version 1.4.1:

  • add feature of matched methods
  • add setting of panel positions, including suspended position and devtools position
  • optimize the user experience for new users
  • fix listener rejected error

ajax-interceptor's People

Contributors

dependabot[bot] avatar pistachio-yaya avatar powderbluee avatar ygyooo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ajax-interceptor's Issues

支持devtools下H5模式

当前pc模式下出现一个config窗口,但H5模式下窗口铺满了屏幕,且不能收起,建议增加类似vconsole的收起小图标

Vue & React 开发者工具丢失

打开 ajax-interceptor 插件 刷新 vue React 项目,开发者工具丢失
关闭 ajax-interceptor 插件 刷新 vue React 项目,开发者工具再次出现

插件即使没有开启也会影响 growingio 上的数据展示

看来下network,插件在chrome中启用,但是没有打开插件开关时,请求是:
https://www.growingio.com/v5/projects/${projectid}/chartdata,返回404
插件在chrome中关闭时,请求是:
https://gta0.growingio.com/_private/v5/projects/${projectid}/chartdata,返回200

为啥插件开关没有开启,仍然会影响页面?

Need some advice

Hello:
I found your Chrome Extension, it is a good repo.
I want to do some similar things, but I need some advices:
I want to write one Chrome Extension to catch some DOM changes, but quite often the DOM changes are not direct results of Ajax requests.
So I want to write some simple JavaScript to scan the DOM, esp. one HTML table, and find any changes in the table cells' innerText, and, if any, I can put the changed table Cells' innerText into a map, then Json stringfy the map, then send the Json format string to an external WebSocket server (C#).
I know how to write the JavaScript to do the job, and I want to run the JavaScript every 10 seconds.
I want to know where I should put the JavaScript? In the background.js or in the content.js?
Please advise! You can use Chinese, if necessary. For me, typing Chinese is too much time-consuming.

程序运行报错

运行后显示store-proxy2.html?iframe_delete=true:16 Uncaught TypeError: t.slice is not a function
at r (store-proxy2.html?iframe_delete=true:16:865)

Encoding problem in fetch

Thanks for the good idea of this repo.

I met a problem that chinese characters in response would be garbled, and I found that error happened when transferred string to arraybuffer below.
const bufView = new Uint8Array(new ArrayBuffer(txt.length)); for (var i = 0; i < txt.length; i++) { bufView[i] = txt.charCodeAt(i); }

I tried to use TextEncoder to solve this problem.
const encoder = new TextEncoder(); const view = encoder.encode(txt);

Could you reproduct it and provide with any other solution?

可以提个建议吗:在开发者工具中添加一个panel

可以在dev tools中加个panel吗,就像 vue dev tools一样。
这个panel可以模拟 开发者工具里面的network

  • 显示所有连接,当被修改后,可以显示修改后的连接。像network一样有request,response等
  • 右击某个连接可以添加拦截。会弹出一个对话框,设置拦截规则。
  • 假如当前连接被拦截,则添加一个标签或高亮显示。
  • 提供一个按键,点击后弹窗或其他方式显示所有拦截,并可以修改。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.