Allows you to inspect web pages
这是此脚本的所有版本。 只显示代码更新过的版本
support iframe.srcdoc (excluding optional doctype declaration and top-level elements that are not included in the HTML tag)
pass spanNode.outerHTML instead just spanNode
indentation fix
fixed bug that attempted to use the postMessage API when the url does not have an originthis caused getIframeContent to fail and makes the timeout checking redundant
the debugAlert s showed that getUrlOrigin returned a null value. getUrlOrigin changed to give an error if that happens
more debugAlert statements to find out what causes a promise rejection after using getIframeContent
change spanNode(className, innerTextOrText) to automatically convert strings to text nodes and append text nodes instead of writing innerText
use Node.nodeType instead of instanceof Text because that doesnt always work
convert multi-line comments to single line comments so that webkit-based browsers report the correct line number in the error stackmove some parts into functions for clearer control flow
get better error details. not all error properties, including the message and error type are iterable
try catch in window.WEB_INSPECTOR assignment failed, so use a function instead
make sure errors get passed up correctly
make sure error passed up correctly
make sure errors are correctly passed up
make sure errors get correctly passed up, more error info
Promise.race([]).then was not called in the timeout case. this changes that hopefully
incorrect resolve got called in last update
previous update didnt fix timeout issue correctly, hopefully this one does
correctly deal with timeout issue when trying to get iframe content. await Promise.race would wait for all promises to be resolved or rejected. that caused the userscript to not work correctly on safari mobile
await Promise.race
move code for getting iframe content into its own functionremove message event from window if timeout reached
add timeout of 5 seconds to getting iframe content encase of postMessage not responding
better to use event.origin rather than passing it in the message
try to make postMessage communicate back to top on safari mobile
remove checking event.origin when self is not top because top.location.href and top.location.toString() fail silently on safari mobile. using event.source === top is fine
make sure all outputted text can be read. use red for errors. add debugAlert function to find out why it doesnt currently work on safari on mobile
add missing semicolons
bug fix for previous bug fix
display error message if iframe content cannot be retrieved
correctly get html iframe tag contentautomatically collapse all collapsible html tags, unless they have less than 1 child (for performance reasons)
fix error while trying to inspect iframe content. better error message.
add error handeling
show content of iframe and similar elements. they are now automatically collapsed
put ending } in css on new line. before only declarations and @media had the new line in css
clickable links open in new tab/window by default now instead of same tab/window
add outline to css-color-preview (using the css invert function) to give better contrast
made
fixed sandboxing issue when trying to open a new tab/window to display web inspectormore accurate html nodeType detection