(force)
| 645 | document.body.appendChild(script); |
| 646 | } |
| 647 | getBaseFileName(force) { |
| 648 | //Only once game and core is loaded |
| 649 | if (!this.started && !force) return null; |
| 650 | if (force && this.config.gameUrl !== "game" && !this.config.gameUrl.startsWith("blob:")) { |
| 651 | return this.config.gameUrl.split("/").pop().split("#")[0].split("?")[0]; |
| 652 | } |
| 653 | if (typeof this.config.gameName === "string") { |
| 654 | const invalidCharacters = /[#<$+%>!`&*'|{}/\\?"=@:^\r\n]/ig; |
| 655 | const name = this.config.gameName.replace(invalidCharacters, "").trim(); |
| 656 | if (name) return name; |
| 657 | } |
| 658 | if (!this.fileName) return "game"; |
| 659 | let parts = this.fileName.split("."); |
| 660 | parts.splice(parts.length - 1, 1); |
| 661 | return parts.join("."); |
| 662 | } |
| 663 | saveInBrowserSupported() { |
| 664 | return !!window.indexedDB && (typeof this.config.gameName === "string" || !this.config.gameUrl.startsWith("blob:")); |
| 665 | } |
no outgoing calls
no test coverage detected