PixelBoii

Untitled

Oct 31st, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. chrome.runtime.onMessage.addListener(
  2.     function(request, sender, sendResponse) {
  3.       if (request.contentScriptQuery == "queryPrice") {
  4.         var url = "https://pixelboii.wtf/steamvalue.json";
  5.         var skinFullName = request.itemURL;
  6.         fetch(url)
  7.             .then(res => res.json())
  8.             .then(price => {
  9.               sendResponse(price.items_list[skinFullName].price["7_days"].average);
  10.             })
  11.             .catch(err => { throw err });
  12.         return true;  // Will respond asynchronously.
  13.       }
  14.     });
Add Comment
Please, Sign In to add comment