2010-04-20 3 views
2

ExceptionHub http://www.exceptionhub.com/이 사용자의 브라우저에서 자바 스크립트 오류를 ​​어떻게 추적하는지 궁금하십니까?예외 허브는 어떻게 작동합니까?

+0

이 제품은 전통적인 의미에서 실제로 오픈 소스가 아니기 때문에 * 및 *는 대부분의 사람들이 익숙하게 사용할 수있는 것이 아니며 ** 귀하의 질문은 매우 모호합니다. 만족스러운 대답을 얻는 것은 슬림합니다. –

답변

1

내가 전에이 제품을 사용하지 않은,하지만 그들이 제공하는 무엇을보고하여, 여기에 내 생각이 어떻게 작동하는지에있다 : 추적 스크립트는 아마를 통해 검색 그 페이지가 설치되어 있고 발견 할 수있는 모든 JavaScript 코드 (예 : <script> 태그 또는 onclick과 같은 핸들러)를 try-catch 블록에 래핑하고 예외가 발생하면 제어가 수행되며 수행해야하는 모든 작업을 수행합니다 예 : 예외를보고합니다.

0

스크립트를 살펴본 후. @casblanca가 맞는 것 같습니다. 모든 이벤트를 시도하고 setTimeout 및 setInterval을 포함하는 try catch가있는 것으로 보입니다.

initialFunctionWrap: function() { 
    if (this.initial_wrap_ran === false) { 
     this.initial_wrap_ran = true; 
     var b = []; 
     if (this.firefox) { 
      b = ["Console", "JSpec", "printStackTrace", "ExceptionHub", "EHConsole", "getInterface", "_FirebugCommandLine", "_firebug", "_getFirebugConsoleElement", "loadFirebugConsole", "console", "window", "_FirebugConsole", "document", "navigator", "netscape", "XPCSafeJSObjectWrapper", "XPCNativeWrapper", "Components", "sessionStorage", "globalStorage", "getComputedStyle", "dispatchEvent", "removeEventListener", "name", "parent", "top", "dump", "getSelection", "scrollByLines", "scrollbars", "scrollX", "scrollY", "scrollTo", "scrollBy", "scrollByPages", "sizeToContent", "setTimeout", "setInterval", "clearTimeout", "clearInterval", "setResizable", "captureEvents", "releaseEvents", "routeEvent", "enableExternalCapture", "disableExternalCapture", "open", "openDialog", "frames", "applicationCache", "self", "screen", "history", "content", "menubar", "toolbar", "locationbar", "personalbar", "statusbar", "directories", "closed", "crypto", "pkcs11", "controllers", "opener", "status", "defaultStatus", "location", "innerWidth", "innerHeight", "outerWidth", "outerHeight", "screenX", "screenY", "mozInnerScreenX", "mozInnerScreenY", "pageXOffset", "pageYOffset", "scrollMaxX", "scrollMaxY", "length", "fullScreen", "alert", "confirm", "prompt", "focus", "blur", "back", "forward", "home", "stop", "print", "moveTo", "moveBy", "resizeTo", "resizeBy", "scroll", "close", "updateCommands", "find", "atob", "btoa", "frameElement", "showModalDialog", "postMessage", "addEventListener", "localStorage", "nsXPCComponents", "Cufon"] 
     } else { 
      if (window.opera) { 
       b = ["open", "print", "stop", "getComputedStyle", "getSelection", "releaseEvents", "captureEvents", "dispatchEvent", "alert", "confirm", "prompt", "setTimeout", "setInterval", "addEventStream", "removeEventStream", "clearInterval", "clearTimeout", "back", "forward", "attachEvent", "detachEvent", "addEventListener", "removeEventListener", "navigate", "DOMParser", "XMLHttpRequest", "XMLSerializer", "XPathEvaluator", "XSLTProcessor", "opera", "Image", "Option", "frames", "Audio", "SVGUnitTypes", "SVGZoomAndPan", "java", "netscape", "sun", "Packages", "ImageData", "ByteArray", "printStackTrace", "ExceptionHub", "EHConsole", "props", "prop", "console", "closed", "defaultStatus", "document", "event", "frameElement", "history", "innerHeight", "innerWidth", "location", "name", "navigator", "opener", "outerHeight", "outerWidth", "pageXOffset", "pageYOffset", "parent", "screen", "screenLeft", "screenTop", "screenX", "screenY", "self", "status", "top", "window", "length", "Cufon"] 
      } else { 
       if (window.chrome) { 
        b = ["JSpec", "captures", "top", "window", "location", "chromium", "chrome", "external", "document", "ExceptionHub", "EHConsole", "SVGPathSegLinetoVerticalRel", "SVGFESpotLightElement", "SVGAnimatedNumber", "SVGPoint", "SVGScriptElement", "SVGFEPointLightElement", "SVGPathSegList", "SVGImageElement", "SharedWorker", "SVGAElement", "SVGAnimatedRect", "SVGGElement", "SVGLinearGradientElement", "SVGForeignObjectElement", "SVGAnimateElement", "SVGFontElement", "SVGFontFaceElement", "SVGPathSegCurvetoQuadraticSmoothRel", "SVGStopElement", "SVGViewElement", "SVGPathSegMovetoRel", "SVGFEImageElement", "SVGPathSegMovetoAbs", "SVGAnimatedTransformList", "SVGPathSegCurvetoQuadraticAbs", "SVGFilterElement", "SVGFETileElement", "SVGFEComponentTransferElement", "SVGAnimatedPreserveAspectRatio", "SVGRectElement", "SVGLineElement", "SVGDocument", "MessagePort", "SVGDescElement", "SVGPathSegLinetoRel", "SVGEllipseElement", "SVGFEFuncRElement", "HTMLAllCollection", "SVGAnimatedNumberList", "SVGElementInstance", "SVGPathSegLinetoHorizontalRel", "SVGPathSegLinetoHorizontalAbs", "SVGComponentTransferFunctionElement", "SVGStyleElement", "SVGNumberList", "Blob", "SVGFEFloodElement", "SVGFEBlendElement", "SVGFEGaussianBlurElement", "SVGTextElement", "SVGFEOffsetElement", "RGBColor", "SVGGlyphElement", "SVGZoomEvent", "SVGElementInstanceList", "SVGFEDisplacementMapElement", "SVGPathSegCurvetoCubicSmoothRel", "SVGFEDistantLightElement", "ImageData", "SVGFEFuncBElement", "SVGCircleElement", "SVGSetElement", "SVGFEMergeElement", "SVGFESpecularLightingElement", "SVGNumber", "SVGFontFaceSrcElement", "SVGElement", "SVGMissingGlyphElement", "SVGPathSegLinetoVerticalAbs", "SVGTextPositioningElement", "SVGFEFuncGElement", "SVGPathSegCurvetoQuadraticRel", "SVGPathSegCurvetoQuadraticSmoothAbs", "SVGRect", "SVGFontFaceFormatElement", "SVGAnimateTransformElement", "SVGPathSegCurvetoCubicSmoothAbs", "SVGPathSegClosePath", "SVGPathSegArcRel", "SVGAnimatedString", "SVGTransformList", "SVGFEMorphologyElement", "SVGAnimatedLength", "SVGPolygonElement", "SVGPathSegLinetoAbs", "SVGMaskElement", "SVGPathElement", "SVGStringList", "MessageChannel", "BeforeLoadEvent", "PageTransitionEvent", "SVGAnimatedLengthList", "SVGRadialGradientElement", "SVGCursorElement", "SVGPathSegCurvetoCubicAbs", "SVGUseElement", "SVGSwitchElement", "SVGLengthList", "SVGPathSegArcAbs", "SVGAnimatedBoolean", "SVGFontFaceUriElement", "SVGPointList", "SVGPathSegCurvetoCubicRel", "SVGMetadataElement", "SVGTitleElement", "SVGAnimatedAngle", "SVGAnimateColorElement", "SVGMatrix", "SVGSymbolElement", "SVGFEDiffuseLightingElement", "SVGFETurbulenceElement", "SVGAnimatedEnumeration", "SVGFEMergeNodeElement", "SVGAnimatedInteger", "SVGDefsElement", "SVGSVGElement", "SVGAltGlyphElement", "SVGClipPathElement", "SVGPolylineElement", "SVGPatternElement", "SVGFECompositeElement", "SVGFEColorMatrixElement", "SVGTRefElement", "SVGFEFuncAElement", "WebSocket", "SVGTSpanElement", "SVGFontFaceNameElement", "HTMLButtonElement", "webkitNotifications", "pageYOffset", "EntityReference", "NodeList", "screenY", "navigator", "MimeTypeArray", "offscreenBuffering", "sessionStorage", "OverflowEvent", "HTMLTableColElement", "HTMLOptionElement", "HTMLInputElement", "defaultStatus", "SVGMarkerElement", "HTMLLinkElement", "WebKitCSSTransformValue", "MutationEvent", "Clipboard", "HTMLTableElement", "toolbar", "innerHeight", "applicationCache", "pageXOffset", "Element", "opener", "CSSStyleSheet", "StyleSheetList", "HTMLHRElement", "WebKitPoint", "media", "screenLeft", "SVGGradientElement", "HTMLDivElement", "HTMLQuoteElement", "KeyboardEvent", "screenX", "RangeException", "SVGTextPathElement", "HTMLLegendElement", "MouseEvent", "MediaError", "HTMLObjectElement", "HTMLFontElement", "WebKitTransitionEvent", "MediaList", "SVGPaint", "Document", "XPathException", "innerWidth", "TextMetrics", "personalbar", "HTMLHeadElement", "ProgressEvent", "Node", "CSSPageRule", "CharacterData", "length", "ClientRect", "Option", "Notation", "StorageEvent", "HTMLFieldSetElement", "HTMLVideoElement", "locationbar", "SVGRenderingIntent", "UIEvent", "HTMLTableRowElement", "HTMLDListElement", "File", "CSSValue", "HTMLParamElement", "HTMLModElement", "scrollY", "outerHeight", "CSSFontFaceRule", "SVGPathSeg", "Rect", "CSSStyleDeclaration", "StyleSheet", "SVGColor", "clientInformation", "HTMLStyleElement", "HTMLBaseElement", "HTMLBRElement", "HTMLHtmlElement", "HTMLTextAreaElement", "HTMLBaseFontElement", "scrollbars", "screen", "localStorage", "defaultstatus", "HTMLCanvasElement", "ProcessingInstruction", "HTMLFrameElement", "frames", "HTMLElement", "HTMLSelectElement", "HTMLIsIndexElement", "HTMLDocument", "HTMLCollection", "HTMLDirectoryElement", "CSSMediaRule", "MessageEvent", "DOMException", "CSSRule", "WebKitCSSMatrix", "status", "HTMLScriptElement", "DOMImplementation", "SVGLength", "HTMLOptGroupElement", "HTMLAreaElement", "HTMLFrameSetElement", "name", "self", "HTMLIFrameElement", "Comment", "Event", "Storage", "XMLSerializer", "statusbar", "Range", "HTMLPreElement", "Image", "parent", "closed", "crypto", "CSSVariablesDeclaration", "HTMLOListElement", "HTMLFormElement", "DOMParser", "console", "EventException", "scrollX", "HTMLMediaElement", "XMLDocument", "HTMLHeadingElement", "XMLHttpRequest", "TextEvent", "event", "CSSVariablesRule", "HTMLAppletElement", "devicePixelRatio", "FileList", "CanvasRenderingContext2D", "HTMLMarqueeElement", "WebKitCSSKeyframesRule", "XSLTProcessor", "CSSImportRule", "CSSRuleList", "SVGTransform", "SVGTextContentElement", "HTMLTableCellElement", "DocumentFragment", "SVGPreserveAspectRatio", "HTMLMapElement", "XPathResult", "HTMLLIElement", "Plugin", "HTMLParagraphElement", "HTMLBlockquoteElement", "outerWidth", "CSSStyleRule", "Text", "HTMLUListElement", "CSSPrimitiveValue", "HTMLEmbedElement", "PluginArray", "ClientRectList", "CSSCharsetRule", "menubar", "HTMLBodyElement", "HTMLAudioElement", "CDATASection", "WebKitCSSKeyframeRule", "Audio", "history", "Entity", "HTMLTableCaptionElement", "MimeType", "SVGException", "NamedNodeMap", "XMLHttpRequestUpload", "WebKitAnimationEvent", "HTMLMenuElement", "SVGAngle", "XPathEvaluator", "HTMLImageElement", "NodeFilter", "Attr", "Counter", "CSSValueList", "XMLHttpRequestException", "WheelEvent", "SVGUnitTypes", "HTMLLabelElement", "HTMLAnchorElement", "frameElement", "DocumentType", "HTMLTableSectionElement", "HTMLTitleElement", "HTMLMetaElement", "Worker", "screenTop", "onwebkittransitionend", "onmouseover", "onmouseup", "ondragend", "onerror", "onsearch", "close", "onkeydown", "ondragstart", "onseeking", "postMessage", "onfocus", "ondurationchange", "onreset", "onkeyup", "onpause", "onended", "ondragenter", "onpagehide", "ondblclick", "onloadeddata", "ondragleave", "onvolumechange", "onbeforeunload", "onresize", "blur", "onloadstart", "onmousedown", "onloadedmetadata", "onabort", "onstalled", "onpageshow", "ononline", "onkeypress", "onclick", "oninvalid", "onsubmit", "onseeked", "onoffline", "onemptied", "onwebkitanimationiteration", "onsuspend", "onstorage", "onload", "onwaiting", "oncanplay", "onratechange", "ondragover", "onunload", "onpopstate", "onplay", "onwebkitanimationstart", "onplaying", "oncanplaythrough", "onselect", "focus", "onmousemove", "ondrag", "onmessage", "onscroll", "ontimeupdate", "onchange", "oncontextmenu", "onmousewheel", "onblur", "onmouseout", "oninput", "ondrop", "onwebkitanimationend", "onprogress", "onhashchange", "getSelection", "print", "stop", "open", "showModalDialog", "alert", "confirm", "prompt", "find", "scrollBy", "scrollTo", "scroll", "moveBy", "moveTo", "resizeBy", "resizeTo", "setTimeout", "clearTimeout", "setInterval", "clearInterval", "atob", "btoa", "addEventListener", "removeEventListener", "captureEvents", "releaseEvents", "getComputedStyle", "getMatchedCSSRules", "webkitConvertPointFromPageToNode", "webkitConvertPointFromNodeToPage", "openDatabase", "dispatchEvent", "Cufon", "FormData"] 
       } else { 
        b = ["JSpec", "printStackTrace", "ExceptionHub", "EHConsole", "document", "window", "EvalError", "RangeError", "ReferenceError", "SyntaxError", "TypeError", "URIError", "getComputedStyle", "getMatchedCSSRules", "moveBy", "find", "resizeTo", "clearTimeout", "btoa", "setTimeout", "scrollBy", "print", "resizeBy", "atob", "openDatabase", "moveTo", "scroll", "confirm", "showModalDialog", "close", "clearInterval", "webkitConvertPointFromNodeToPage", "open", "prompt", "focus", "blur", "scrollTo", "removeEventListener", "postMessage", "setInterval", "getSelection", "alert", "stop", "webkitConvertPointFromPageToNode", "addEventListener", "dispatchEvent", "captureEvents", "releaseEvents", "_inspectorCommandLineAPI", "frames", "HTMLBodyElement", "onseeking", "menubar", "onended", "onsuspend", "pageXOffset", "length", "CSSPrimitiveValue", "frameElement", "HTMLMenuElement", "NodeFilter", "MouseEvent", "TextEvent", "onreset", "HTMLQuoteElement", "onwebkitanimationiteration", "WebKitPoint", "HTMLIsIndexElement", "XMLHttpRequestUpload", "CSSCharsetRule", "HTMLAppletElement", "HTMLCollection", "statusbar", "XMLHttpRequestException", "HTMLStyleElement", "ondragleave", "DOMException", "HTMLFrameSetElement", "clientInformation", "localStorage", "onloadedmetadata", "HTMLUListElement", "CharacterData", "name", "ondragstart", "HTMLLegendElement", "XPathResult", "HTMLPreElement", "onkeydown", "onwebkitanimationstart", "ondblclick", "XSLTProcessor", "CSSRuleList", "onmousemove", "WebKitTransitionEvent", "outerHeight", "CSSVariablesDeclaration", "ondragend", "history", "SVGUnitTypes", "top", "parent", "CanvasRenderingContext2D", "TextMetrics", "ClientRectList", "HTMLButtonElement", "onunload", "HTMLMapElement", "scrollY", "Plugin", "CSSStyleSheet", "ondrag", "Attr", "EntityReference", "HTMLTableCaptionElement", "HTMLObjectElement", "self", "MutationEvent", "pageYOffset", "HTMLInputElement", "screenLeft", "onkeyup", "HTMLScriptElement", "onmousewheel", "onstorage", "HTMLOListElement", "HTMLCanvasElement", "CSSFontFaceRule", "XMLDocument", "HTMLBRElement", "CSSStyleRule", "HTMLFontElement", "HTMLTitleElement", "Node", "HTMLTableSectionElement", "Text", "onclick", "HTMLOptionElement", "File", "onvolumechange", "StyleSheetList", "Range", "onmouseover", "HTMLAnchorElement", "innerHeight", "onplaying", "CSSMediaRule", "HTMLEmbedElement", "NodeList", "SVGMarkerElement", "onmouseup", "WebKitAnimationEvent", "SVGColor", "HTMLParamElement", "offscreenBuffering", "HTMLTextAreaElement", "onratechange", "locationbar", "SVGLength", "KeyboardEvent", "MimeTypeArray", "ondragover", "HTMLDivElement", "HTMLBaseElement", "HTMLBaseFontElement", "onsubmit", "HTMLIFrameElement", "HTMLBlockquoteElement", "HTMLAudioElement", "SVGPreserveAspectRatio", "HTMLLIElement", "SVGAngle", "location", "onstalled", "scrollbars", "HTMLMarqueeElement", "SVGPaint", "Entity", "onprogress", "onwaiting", "HTMLModElement", "HTMLFormElement", "opener", "ontimeupdate", "onfocus", "outerWidth", "onplay", "HTMLHeadElement", "ondurationchange", "oncanplay", "onemptied", "MimeType", "HTMLImageElement", "CDATASection", "closed", "event", "DOMParser", "CSSValueList", "navigator", "screen", "FileList", "sessionStorage", "ProcessingInstruction", "ononline", "oncontextmenu", "RangeException", "onoffline", "WheelEvent", "onresize", "Storage", "innerWidth", "Rect", "MessageEvent", "StorageEvent", "HTMLElement", "onsearch", "onseeked", "Counter", "NamedNodeMap", "HTMLOptGroupElement", "HTMLHeadingElement", "Worker", "ondragenter", "onmessage", "onblur", "HTMLParagraphElement", "HTMLFieldSetElement", "ondrop", "personalbar", "HTMLSelectElement", "OverflowEvent", "XPathException", "oncanplaythrough", "ProgressEvent", "status", "onselect", "onpause", "MediaError", "HTMLFrameElement", "CSSRule", "devicePixelRatio", "CSSStyleDeclaration", "WebKitCSSTransformValue", "HTMLTableRowElement", "HTMLDirectoryElement", "Option", "Image", "onloadeddata", "WebKitCSSKeyframesRule", "scrollX", "onwebkittransitionend", "screenY", "onkeypress", "toolbar", "SVGTextContentElement", "HTMLAreaElement", "Event", "screenTop", "Element", "Audio", "DocumentType", "crypto", "UIEvent", "EventException", "defaultStatus", "onwebkitanimationend", "screenX", "SVGTransform", "HTMLHRElement", "CSSImportRule", "defaultstatus", "DocumentFragment", "applicationCache", "CSSPageRule", "onload", "onerror", "XPathEvaluator", "onchange", "MediaList", "console", "onabort", "onbeforeunload", "oninput", "onloadstart", "onmousedown", "onmouseout", "onscroll", "StyleSheet", "CSSValue", "CSSVariablesRule", "DOMImplementation", "Document", "Comment", "Notation", "HTMLDocument", "HTMLDListElement", "HTMLHtmlElement", "HTMLLabelElement", "HTMLLinkElement", "HTMLMetaElement", "HTMLTableCellElement", "HTMLTableColElement", "HTMLTableElement", "WebKitCSSKeyframeRule", "WebKitCSSMatrix", "Clipboard", "XMLSerializer", "XMLHttpRequest", "PluginArray", "ClientRect", "HTMLMediaElement", "HTMLVideoElement", "SVGException", "SVGGradientElement", "SVGPathSeg", "SVGRenderingIntent", "SVGTextPathElement", "Cufon"] 
       } 
      } 
     } 

그런 다음 클라이언트 브라우저를 기반으로 스택 추적을 형식 지정합니다. 그리고이 정보를 서버에 게시하십시오. 대부분 추적 픽셀을 통해 발생합니다.

관련 문제