function isLocalCommercePage() { let queryStart = this.url.indexof("?") let page = queryStart == null ? this.url : this.url.slice(0, queryStart) return page == "http://{{LOCAL_ENDPOINT}}/store" || page == "http://{{LOCAL_ENDPOINT}}/store/" || page == "http://{{LOCAL_ENDPOINT}}/trade.gaijin.net" || page == "http://{{LOCAL_ENDPOINT}}/trade.gaijin.net/" } function onDestroy() { broadcastEvent("DestroyEmbeddedBrowser") if (this.isLocalCommercePage()) addTask(updateEntitlementsLimited(true), null, @() updateGamercards()) }