{"id":1505,"date":"2025-11-09T00:41:19","date_gmt":"2025-11-08T16:41:19","guid":{"rendered":"https:\/\/www.ptolemymuseum.org.hk\/?page_id=1505"},"modified":"2025-11-09T00:52:11","modified_gmt":"2025-11-08T16:52:11","slug":"gas-test","status":"publish","type":"page","link":"https:\/\/www.ptolemymuseum.org.hk\/en\/gas-test","title":{"rendered":"Gas &#8211; test"},"content":{"rendered":"<p><!DOCTYPE html><br \/>\n<html lang=\"en\"><br \/>\n<head><br \/>\n    <meta charset=\"UTF-8\"><br \/>\n    <title>\u8df3\u8f6c\u62e6\u622a\u6d4b\u8bd5<\/title><\/p>\n<style>\n        body { font-family: Arial, sans-serif; padding: 20px; }\n        button, a { display: block; margin: 10px 0; padding: 10px; text-decoration: none; background: #0073aa; color: white; border-radius: 4px; width: 200px; text-align: center; }\n        a { background: #555; }\n    <\/style>\n<p><\/head><br \/>\n<body><\/p>\n<h1>\u8df3\u8f6c\u62e6\u622a\u6d4b\u8bd5<\/h1>\n<p><!-- \u5185\u90e8\u94fe\u63a5 --><br \/>\n<a href=\"\/en\/\">\u5185\u90e8\u9996\u9875<\/a><br \/>\n<a href=\"#section1\">\u951a\u70b9\u8df3\u8f6c<\/a><\/p>\n<p><!-- \u5916\u90e8\u94fe\u63a5 --><br \/>\n<a href=\"https:\/\/www.baidu.com\">\u5916\u90e8\u94fe\u63a5 \u767e\u5ea6<\/a><br \/>\n<a href=\"https:\/\/www.google.com\">\u5916\u90e8\u94fe\u63a5 Google<\/a><\/p>\n<p><!-- window.open \u6d4b\u8bd5\u6309\u94ae --><br \/>\n<button id=\"openBaidu\">window.open \u767e\u5ea6<\/button><br \/>\n<button id=\"openGoogle\">window.open Google<\/button><\/p>\n<section id=\"section1\">\n<p>\u8fd9\u91cc\u662f\u951a\u70b9 section1<\/p>\n<\/section>\n<p><script>\n(function() {\n    'use strict';<\/p>\n<p>    const allowedDomain = window.location.origin;<\/p>\n<p>    function isAllowedUrl(url) {\n        if (!url) return true;\n        try {\n            const u = new URL(url, window.location.href);\n            return u.origin === allowedDomain || u.pathname.startsWith('\/') || u.href === 'about:blank';\n        } catch(e) {\n            return false;\n        }\n    }<\/p>\n<p>    \/\/ \u62e6\u622a\u6240\u6709\u70b9\u51fb\u4e8b\u4ef6\n    document.addEventListener('click', function(e) {\n        const a = e.target.closest('a[href]');\n        if (a && !isAllowedUrl(a.href)) {\n            e.preventDefault();\n            e.stopPropagation();\n            console.warn('Blocked external navigation to:', a.href);\n            return false;\n        }\n    }, false);<\/p>\n<p>    \/\/ \u8986\u76d6 window.open\n    const originalOpen = window.open;\n    window.open = function(url, target, features) {\n        if (!isAllowedUrl(url)) {\n            console.warn('Blocked window.open to:', url);\n            return null;\n        }\n        return originalOpen.call(window, url, target, features);\n    };<\/p>\n<p>    \/\/ \u6d4b\u8bd5\u6309\u94ae\u4e8b\u4ef6\u7ed1\u5b9a\n    document.getElementById('openBaidu').addEventListener('click', function() {\n        window.open('https:\/\/www.baidu.com');\n    });\n    document.getElementById('openGoogle').addEventListener('click', function() {\n        window.open('https:\/\/www.google.com');\n    });<\/p>\n<p>})();\n<\/script><\/p>\n<p><\/body><br \/>\n<\/html><\/p>","protected":false},"excerpt":{"rendered":"<p>\u8df3\u8f6c\u62e6\u622a\u6d4b\u8bd5 \u8df3\u8f6c\u62e6\u622a\u6d4b\u8bd5 \u5185\u90e8\u9996\u9875 \u951a\u70b9\u8df3\u8f6c \u5916\u90e8\u94fe\u63a5 \u767e\u5ea6 \u5916\u90e8\u94fe\u63a5 Google window.open [&hellip;]<\/p>","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-1505","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/pages\/1505","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/comments?post=1505"}],"version-history":[{"count":2,"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/pages\/1505\/revisions"}],"predecessor-version":[{"id":1508,"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/pages\/1505\/revisions\/1508"}],"wp:attachment":[{"href":"https:\/\/www.ptolemymuseum.org.hk\/en\/wp-json\/wp\/v2\/media?parent=1505"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}