wkitd/src/utils.js

29 lines
518 B
JavaScript
Raw Normal View History

2023-08-10 19:59:02 +08:00
/**
* {}
* @author yutent<yutent.io@gmail.com>
* @date 2023/08/10 10:07:51
*/
export function noop() {}
export function hideProp(host, name, value) {
Object.defineProperty(host, name, {
value,
enumerable: false,
writable: true
})
}
// 判定A标签的target属性是否指向自身
export function targetIsThisWindow(target) {
if (
!target ||
target === window.name ||
target === '_self' ||
(target === 'top' && window == window.top)
) {
return true
}
return false
}