(script)
| 556 | } |
| 557 | |
| 558 | function checkIsPreview(script) { |
| 559 | if ( |
| 560 | location.hostname === "useful-scripts-extension.github.io" || |
| 561 | location.hostname === "hoangtran0410.github.io" || |
| 562 | location.hostname === "127.0.0.1" |
| 563 | ) { |
| 564 | trackEvent("CLICK_PREVIEW_" + script.id); |
| 565 | Swal.fire({ |
| 566 | icon: "info", |
| 567 | title: t({ vi: "Đây là bản xem trước", en: "This is a preview" }), |
| 568 | text: t({ |
| 569 | vi: "Vui lòng tải và cài đặt tiện ích Useful-script để sử dung chức năng này nhé", |
| 570 | en: "Please install Useful-script extension to use these features", |
| 571 | }), |
| 572 | confirmButtonText: t({ vi: "Xem hướng dẫn", en: "View tutorial" }), |
| 573 | cancelButtonText: t({ vi: "Đã hiểu", en: "Ok" }), |
| 574 | showCancelButton: true, |
| 575 | reverseButtons: true, |
| 576 | }).then((res) => { |
| 577 | if (res.isConfirmed) { |
| 578 | window.open( |
| 579 | "https://www.facebook.com/groups/1154059318582088/posts/1453443235310360/", |
| 580 | "_blank" |
| 581 | ); |
| 582 | } |
| 583 | }); |
| 584 | return true; |
| 585 | } |
| 586 | return false; |
| 587 | } |
| 588 | |
| 589 | async function runScript(scriptMetadata) { |
| 590 | if (checkIsPreview(scriptMetadata)) return; |
no test coverage detected