Được TopGit lập chỉ mục từ metadata GitHub: jpillora/xhook có 1.0k sao, viết chủ yếu bằng HTML. Easily intercept and modify XHR request and response
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
Modifying any property of the response object will modify the underlying XHR before it is received.
To make the handler is asynchronous, just include the optional callback function.
xhook.enable()
Enables XHook (swaps out the native XMLHttpRequest class). XHook is enabled be default.
xhook.disable()
Disables XHook (swaps the native XMLHttpRequest class back in)
request Object
method (String) (open(method,url))
url (String) (open(method,url))
body (String) (send(body))
headers (Object) (Contains Name-Value pairs set with setRequestHeader(name,value))
timeout (Number) (timeout)
type (String) (responseType)
withCredentials (String) (withCredentials)
response Object
status (Number) Required when for fake responses(status)
statusText (String) (statusText)
text (String) (responseText)
headers (Object) (Contains Name-Value pairs retrieved with getAllResponseHeaders())
xml (XML) (responseXML)
data (Varies) (response)
Overview
The dark red before hook is returning a response object, which will trigger the after
hooks, then trigger the appropriate events, so itappearsas if response came from
the server.
XHook does not attempt to resolve any browser compatibility issues. Libraries like jQuery
and https://github.com/ilinsky/xmlhttprequest will attempt to do this. XHook simply proxies to and from XMLHttpRequest, so you may use any library
conjunction with XHook, just make sure to load XHook first.
You may use synchronous XHR, though this will cause asynchronous hooks to be skipped.
Contributing
See CONTRIBUTING for instructions on how to build and run XHook locally.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/jpillora/xhook là nguồn chính thức.
jpillora/xhook có phải mã nguồn mở không?
Có — jpillora/xhook phát hành theo license MIT, nghĩa là mã nguồn mở để đọc, fork và (tùy license) tái sử dụng. Mã: github.com/jpillora/xhook.
jpillora/xhook có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho jpillora/xhook. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
jpillora/xhook có trang demo không?
Dự án có trang chủ ở http://jpillora.com/xhook. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
jpillora/xhook còn đang phát triển không?
Commit gần nhất trên jpillora/xhook là 2.1 năm trước (theo timestamp GitHub). Repo có 153 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
jpillora/xhook dùng license gì?
jpillora/xhook phát hành theo license MIT. Nên mở file LICENSE trên GitHub để xác nhận — license metadata đôi khi lệch với thực tế dự án.
Đọc đầy đủ README ở tab phía trên.
Chưa chắc xhook có hợp với bạn?
Để ChatGPT, Claude hoặc Perplexity tìm hiểu giúp — bấm bên dưới và xem AI nói gì về xhook.