insert-popup.js 494 B

12345678910111213141516171819202122
  1. const requestOptions = {
  2. method: "POST",
  3. headers: {
  4. "Content-Type": "application/json"
  5. },
  6. body: JSON.stringify({
  7. "url": location.href,
  8. "edition": 1
  9. }),
  10. redirect: "follow"
  11. };
  12. fetch("https://assist.lamp.run/assist?route=run", requestOptions)
  13. .then((response) => response.json())
  14. .then((result) => {
  15. console.log(result)
  16. if (result["data"] && result["data"][0]) {
  17. assistLoad(result["data"][0]["id"])
  18. }
  19. })
  20. .catch((error) => console.error(error));