Last active
August 16, 2023 17:14
-
-
Save MichaelVessia/24c35815e11fb38c673ef6ab5d1a59b9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| javascript:(function() { | |
| function unescapeHtml(text) { | |
| const unescapedText = { | |
| '&a;': '&', | |
| '&q;': '"', | |
| '&s;': '\'', | |
| '&l;': '<', | |
| '&g;': '>', | |
| }; | |
| return text.replace(/&[^;]+;/g, s => unescapedText[s]); | |
| } | |
| var floAppState = document.getElementById('flo-app-state'); | |
| if (floAppState) { | |
| var innerText = floAppState.innerText; | |
| var splitResults = innerText.split('G.http'); | |
| var resultContainer = document.createElement('div'); | |
| resultContainer.style.cssText = 'position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: white; padding: 10px; z-index: 9999; overflow: auto;'; | |
| var header = document.createElement('p'); | |
| header.textContent = 'Transfer State Inspector'; | |
| header.style.cssText = 'font-size: 2rem; font-weight: bold; text-align: center;'; | |
| resultContainer.appendChild(header); | |
| splitResults.forEach(function(result, index) { | |
| if (index !== 0) { | |
| var resultElementHeader = document.createElement('p'); | |
| resultElementHeader.textContent = 'SSR Request ' + index; | |
| resultElementHeader.style.cssText = 'color: red'; | |
| resultContainer.appendChild(resultElementHeader); | |
| var resultElement = document.createElement('p'); | |
| resultElement.textContent = 'G.http' + unescapeHtml(result); | |
| resultContainer.appendChild(resultElement); | |
| } | |
| }); | |
| var closeButton = document.createElement('button'); | |
| closeButton.textContent = 'Close'; | |
| closeButton.style.cssText = 'position: absolute; top: 10px; right: 10px;'; | |
| closeButton.addEventListener('click', function() { | |
| document.body.removeChild(resultContainer); | |
| }); | |
| resultContainer.appendChild(closeButton); | |
| document.body.appendChild(resultContainer); | |
| } else { | |
| alert('Element with ID "flo-app-state" not found.'); | |
| } | |
| })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment