@yorkjs/web-error
Advanced tools
Comparing version 1.0.4 to 1.0.5
/** | ||
* web-error.js v1.0.4 | ||
* web-error.js v1.0.5 | ||
* (c) 2021-2022 shushu2013 | ||
@@ -59,4 +59,4 @@ * Released under the MIT License. | ||
}; | ||
// 忽略 Script error. 错误 | ||
if (config.ignoreScriptError && msgObj.error === 'Script error.') { | ||
// 忽略跨域脚本错误 [Script error.] | ||
if (config.ignoreCrossScriptError && msgObj.error === 'Script error.') { | ||
return false; | ||
@@ -102,5 +102,5 @@ } | ||
*/ | ||
const version = "1.0.4"; | ||
const version = "1.0.5"; | ||
export { init, sendBeacon, sendImage, version }; | ||
//# sourceMappingURL=web-error.esm.js.map |
@@ -1,2 +0,2 @@ | ||
function r(r){const n=function(n){!function(r,n){try{const o=r.target||r.srcElement;if(o&&o instanceof HTMLElement){const e=o.href||o.src,t={url:location.href,type:2,error:r.message||e,file:r.filename||e,line:r.lineno,column:r.colno};n.reportError(t)}}catch(r){}}(n,r)},o=window.onerror;window.onerror=function(n,e,t,i,c){o&&o(n,e,t,i,c);try{const o={url:location.href,type:1,error:n.toString(),file:e,line:t,column:i};if(r.ignoreScriptError&&"Script error."===o.error)return!1;r.reportError(o)}catch(r){}return!1},window.addEventListener?window.addEventListener("error",n,!0):window.attachEvent&&window.attachEvent("onerror",n)}function n(r,n){let o=new Image;o.onload=o.onerror=function(){o=o.onload=o.onerror=null},o.src=`${r}?${n}`}function o(r,n){navigator.sendBeacon(r,n)}function e(n){r(n)}const t="1.0.4";export{e as init,o as sendBeacon,n as sendImage,t as version}; | ||
function r(r){const n=function(n){!function(r,n){try{const o=r.target||r.srcElement;if(o&&o instanceof HTMLElement){const e=o.href||o.src,t={url:location.href,type:2,error:r.message||e,file:r.filename||e,line:r.lineno,column:r.colno};n.reportError(t)}}catch(r){}}(n,r)},o=window.onerror;window.onerror=function(n,e,t,i,c){o&&o(n,e,t,i,c);try{const o={url:location.href,type:1,error:n.toString(),file:e,line:t,column:i};if(r.ignoreCrossScriptError&&"Script error."===o.error)return!1;r.reportError(o)}catch(r){}return!1},window.addEventListener?window.addEventListener("error",n,!0):window.attachEvent&&window.attachEvent("onerror",n)}function n(r,n){let o=new Image;o.onload=o.onerror=function(){o=o.onload=o.onerror=null},o.src=`${r}?${n}`}function o(r,n){navigator.sendBeacon(r,n)}function e(n){r(n)}const t="1.0.5";export{e as init,o as sendBeacon,n as sendImage,t as version}; | ||
//# sourceMappingURL=web-error.esm.min.js.map |
/** | ||
* web-error.js v1.0.4 | ||
* web-error.js v1.0.5 | ||
* (c) 2021-2022 shushu2013 | ||
@@ -65,4 +65,4 @@ * Released under the MIT License. | ||
}; | ||
// 忽略 Script error. 错误 | ||
if (config.ignoreScriptError && msgObj.error === 'Script error.') { | ||
// 忽略跨域脚本错误 [Script error.] | ||
if (config.ignoreCrossScriptError && msgObj.error === 'Script error.') { | ||
return false; | ||
@@ -108,3 +108,3 @@ } | ||
*/ | ||
var version = "1.0.4"; | ||
var version = "1.0.5"; | ||
@@ -111,0 +111,0 @@ exports.init = init; |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).Url={})}(this,(function(e){"use strict";function r(e){var r=function(r){!function(e,r){try{var n=e.target||e.srcElement;if(n&&n instanceof HTMLElement){var o=n.href||n.src,t={url:location.href,type:2,error:e.message||o,file:e.filename||o,line:e.lineno,column:e.colno};r.reportError(t)}}catch(e){}}(r,e)},n=window.onerror;window.onerror=function(r,o,t,i,c){n&&n(r,o,t,i,c);try{var a={url:location.href,type:1,error:r.toString(),file:o,line:t,column:i};if(e.ignoreScriptError&&"Script error."===a.error)return!1;e.reportError(a)}catch(e){}return!1},window.addEventListener?window.addEventListener("error",r,!0):window.attachEvent&&window.attachEvent("onerror",r)}e.init=function(e){r(e)},e.sendBeacon=function(e,r){navigator.sendBeacon(e,r)},e.sendImage=function(e,r){var n=new Image;n.onload=n.onerror=function(){n=n.onload=n.onerror=null},n.src=e+"?"+r},e.version="1.0.4",Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).Url={})}(this,(function(e){"use strict";function r(e){var r=function(r){!function(e,r){try{var n=e.target||e.srcElement;if(n&&n instanceof HTMLElement){var o=n.href||n.src,t={url:location.href,type:2,error:e.message||o,file:e.filename||o,line:e.lineno,column:e.colno};r.reportError(t)}}catch(e){}}(r,e)},n=window.onerror;window.onerror=function(r,o,t,i,c){n&&n(r,o,t,i,c);try{var a={url:location.href,type:1,error:r.toString(),file:o,line:t,column:i};if(e.ignoreCrossScriptError&&"Script error."===a.error)return!1;e.reportError(a)}catch(e){}return!1},window.addEventListener?window.addEventListener("error",r,!0):window.attachEvent&&window.attachEvent("onerror",r)}e.init=function(e){r(e)},e.sendBeacon=function(e,r){navigator.sendBeacon(e,r)},e.sendImage=function(e,r){var n=new Image;n.onload=n.onerror=function(){n=n.onload=n.onerror=null},n.src=e+"?"+r},e.version="1.0.5",Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=web-error.min.js.map |
{ | ||
"name": "@yorkjs/web-error", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"description": "process web-error and report tool", | ||
@@ -5,0 +5,0 @@ "main": "dist/web-error.js", |
@@ -8,2 +8,2 @@ import { Config } from './type'; | ||
*/ | ||
export declare const version = "1.0.4"; | ||
export declare const version = "1.0.5"; |
@@ -15,4 +15,4 @@ declare global { | ||
export interface Config { | ||
ignoreScriptError?: boolean; | ||
ignoreCrossScriptError?: boolean; | ||
reportError: (err: ErrorMsg) => void; | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13207