try {
  if (window.parent.location.origin === location.origin) {
    window.parent.postMessage({
      type: "CLOSE ACTIVE TAB",
    }, window.location.origin);
  }
} catch (error) {
    // do nothing
}
这段代码就 ok了 |