diff --git a/package.json b/package.json index 674695f6..d3c83a9f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "returners-open-loot-chrome-extension", "displayName": "Returners - Open Loot", - "version": "0.3.0", + "version": "1.0.0", "description": "Giving super power to Open Loot", "author": "Zet", "packageManager": "npm@8.19.2", diff --git a/src/contents/creatorCode.tsx b/src/contents/creatorCode.tsx index a3c420a7..de078b60 100644 --- a/src/contents/creatorCode.tsx +++ b/src/contents/creatorCode.tsx @@ -1,18 +1,24 @@ -export {} - +import type { PlasmoContentScript } from "plasmo"; +export const config: PlasmoContentScript = { + matches: ["https://openloot.com/*"], + } + let previousUrl = ''; const observer = new MutationObserver(function(mutations) { -if (location.href !== previousUrl) { + if (location.href !== previousUrl) { previousUrl = location.href; console.log(`URL changed to ${location.href}`); if ( location.href.includes('https://openloot.com/checkout?orderId')) injectCreatorCode() + if ( location.href.includes('https://openloot.com/items/BT0/')) injectVideo() } }); -const config = {subtree: true, childList: true}; -observer.observe(document, config); +const configObs = { + subtree: true, childList: true}; +observer.observe(document, configObs); + @@ -29,4 +35,18 @@ function injectCreatorCode(){ },1500) -} \ No newline at end of file +} + + +function injectVideo(){ + console.log('in inject video'); + setTimeout(()=>{ + let videoContainer = document.createElement('div') + videoContainer.id = "video-container" + document.querySelector('main .chakra-container ').appendChild(videoContainer) + document.querySelector('#video-container').innerHTML = '

A video showcasing how we could have an in-game preview for each NFT

' + + + },1500) +} +export {} diff --git a/src/contents/poc-ingame-visualization.tsx b/src/contents/poc-ingame-visualization.tsx deleted file mode 100644 index dec7e93e..00000000 --- a/src/contents/poc-ingame-visualization.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { useState } from "react" -import type { PlasmoContentScript, PlasmoGetInlineAnchor } from "plasmo"; -import { Box } from "@mui/material"; - - -export const config: PlasmoContentScript = { - matches : [ "https://openloot.com/items/BT0/Darkness_2H_Axe"] - } - - export const getInlineAnchor : - PlasmoGetInlineAnchor = () => - document.querySelector("main .chakra-container div") - -function IndexPopup() { - const [data, setData] = useState("") - - return ( - - - - ) -} - -export default IndexPopup - - - - -