可用的 XUL 跟 JavaScript
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window
onload="doBBSCon()"
xmlns="" rel="nofollow">http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/x-javascript" src="common.js" />
<box flex="1" id="BBS">
</box>
</window>
======= common.js ======
//thanks, scrapbook!
function getUrl(){
try {
url = window.arguments[0];
} catch(ex) {
document.location.href.match(/\?url\=(.*)$/);
url = RegExp.$1;
}
if (!url) return false;
return url;
}
function doBBSCon(){
//要執念就執到底吧! 無聊的堅持:全部用 DOM...
var obj = document.getElementById('BBS');
var newBBS = document.createElementNS('http://www.w3.org/1999/xhtml',
'embed');
var url = getUrl();
if (!url) return false;
newBBS.setAttribute('type', 'application/pcman');
newBBS.setAttribute('fontface', '新細明體'); //這條似乎有問題
newBBS.setAttribute('width', "100%");
newBBS.setAttribute('flex', 1);
newBBS.setAttribute('url', url);
obj.appendChild(newBBS);
}
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 218.184.132.120