Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. (function () {
  2. var originalFetch = fetch;
  3. fetch = function () {
  4. return originalFetch.apply(this, arguments)
  5. .then(function (responseOriginal) {
  6. var responseClose = responseOriginal.clone();
  7.  
  8. responseClose.json().then(function (data) {
  9. console.log('==> data:', data);
  10. console.log('==> url:', responseOriginal.url);
  11. // TODO: work with data ...
  12. });
  13.  
  14. return responseOriginal;
  15. })
  16. };
  17. })();
Add Comment
Please, Sign In to add comment