MozTW 討論區
https://forum.moztw.org/

[問題] 有關xulrunner產生的程式如何全螢幕
https://forum.moztw.org/viewtopic.php?f=18&t=21030
1 頁 (共 1 頁)

發表人:  huki [ 2007-11-23, 11:48 ]
文章主題 :  [問題] 有關xulrunner產生的程式如何全螢幕

最近看到prism覺得很不錯
想自己動手玩玩看xulrunner有沒有辦法寫一些我想要的東西
目前我只是很簡單的一個簡單的程式可以瀏覽我指定的網頁
不過是要全螢幕的

代碼:
--main.xul

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>

<window
   id="main"
   title="Test"
   width="1280"
   height="1024"
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
>
   <script src="main.js"/>   
   <browser flex="1" id="main_browser" src="file://d:/test.html"/>
</window>


代碼:
--main.js

function onLoad() {
   var main_browser = document.getElementById("main_browser");
      
   window.fullScreen = true;
   main_browser.loadURI("file://d:/test.html", null, null);
}

addEventListener("load", onLoad, false);


程式很簡單
網頁也能正常讀取(linux上時loadURI有改
目前在windows上是全螢幕(full screen)是ok的
但拿到我家的linux上就不行了~~~
但是window.fullScreen的值確定有被改掉
但依舊沒辦法全螢幕
換了好幾台家裡的linux都不行
還是要用其他的屬性才能呢?!
麻煩了,謝謝

發表人:  BobChao [ 2007-11-23, 13:35 ]
文章主題 : 

會不會因為執行權限的問題?
http://developer.mozilla.org/en/docs/DO ... fullScreen

發表人:  huki [ 2007-11-23, 14:07 ]
文章主題 : 

BobChao 寫:
會不會因為執行權限的問題?
http://developer.mozilla.org/en/docs/DO ... fullScreen


剛才把全部的權限都變成777了
還是不行
不知有沒有同好有碰到這個問題的
真不想卡在這裡><"

發表人:  alex301 [ 2007-11-23, 20:40 ]
文章主題 : 

Prism 的核心是 Gecko 1.9 嗎?

http://developer.mozilla.org/en/docs/DO ... fullScreen
引言回覆:
Summary
This property indicates whether the window is displayed in full screen mode or not. It is only reliable in Gecko 1.9 (Firefox 3) and later, see the Notes below.

引言回覆:
Notes
This property is only reliable in Mozilla 1.9 (Firefox 3) and later. Mozilla 1.8 and earlier do have this property, but it always returns false, even when the window is in full screen mode (bug 127013).

看這篇好像說要 1.9 以後才會正常...

發表人:  BobChao [ 2007-11-24, 13:35 ]
文章主題 : 

alex301 寫:
Prism 的核心是 Gecko 1.9 嗎?


是啊 ^^;

我講的執行權限不是系統上的檔案權限耶,
是在 Prism 裡要拿到 chrome 的權限 (好比要確定那段 script 不會被當作「網頁裡的程式」,而是由 Prism 呼叫的程式)

不過實際上是怎樣我也不太清楚 orz

發表人:  huki [ 2007-11-26, 14:58 ]
文章主題 : 

目前我唯一成功的作法是在window的屬性裡加入
hidechrome="true"
把標題列給隱藏起來
再設定大小
不過還是不太知道為何linux下xulrunner為何沒辦法把js裡
window.fullScreen正確的顯示出來
而且我的版本是1.9pre2
再次感謝那些有看我帖的大大

1 頁 (共 1 頁) 所有顯示的時間為 UTC + 8 小時
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/