home *** CD-ROM | disk | FTP | other *** search
-
- function OnLoad()
- {
- var contextMenu = document.getElementById("contentAreaContextMenu");
- if (contextMenu)
- {
- contextMenu.addEventListener("popupshowing", Onflashget3Menu, false);
- }
- }
-
- window.addEventListener("load", OnLoad, false);
-
- function Onflashget3Menu(event)
- {
- if(!Findflashget())
- {
- gContextMenu.showItem("flashget3Single",false);
- gContextMenu.showItem("flashget3Seq",false);
- gContextMenu.showItem("flashget3All",false);
-
- return ;
- }
-
- gContextMenu.showItem("flashget3Seq",true);
- if(gContextMenu.onSaveableLink)
- {
- gContextMenu.showItem("flashget3Single",true);
- gContextMenu.showItem("flashget3All",false);
- }
- else
- {
- gContextMenu.showItem("flashget3Single",false);
- gContextMenu.showItem("flashget3All",true);
- }
- }
-
- function Onflashget3Single(event)
- {
- var obj
- try
- {
- const cid = "@flashget.com/FlashgetXpiEx;1";
- obj = Components.classes[cid].createInstance();
- obj = obj.QueryInterface(Components.interfaces.IFlashgetXpi);
- }
- catch (err)
- {
- return;
- }
-
- if ( obj == null )
- {
- return;
- }
-
- var strRef = document.commandDispatcher.focusedWindow.document.URL;
-
- var strUrl = gContextMenu.link.toString();
-
- var strRemark = gContextMenu.target.textContent;
-
- var strCookie = document.commandDispatcher.focusedWindow.document.cookie;
-
- if (strUrl.length <8)
- {
- return false;
- }
-
- obj.AddUrl(strUrl, strRemark, strRef, "FlashGet3",strCookie, 0);
- }
-
- function Onflashget3All(event)
- {
- var obj
- try
- {
- const cid = "@flashget.com/FlashgetXpiEx;1";
- obj = Components.classes[cid].createInstance();
- obj = obj.QueryInterface(Components.interfaces.IFlashgetXpi);
- }
- catch (err)
- {
- return;
- }
-
- if ( obj == null )
- {
- return;
- }
-
- var strRef = document.commandDispatcher.focusedWindow.document.URL;
- var strCookie = document.commandDispatcher.focusedWindow.document.cookie;
-
- var strLinks = document.commandDispatcher.focusedWindow.document.links;
- var strImages = document.commandDispatcher.focusedWindow.document.images;
-
- var nLinkNum = strLinks.length;
- var nImageNum = strImages.length;
-
- var nAllNum = nLinkNum;
-
- var my_array = new Array(nAllNum * 2 + 1);
- my_array[0] = strRef;
-
- var i = 0;
- for (i = 0; i < nLinkNum; i++)
- {
- my_array[i*2+1]=strLinks[i].href.toString();
- my_array[i*2+2]=strLinks[i].innerText ? strLinks[i].innerText : "";
- }
-
- obj.AddAllUrl(my_array.length, my_array, "FlashGet3",strCookie, 0);
- }
-
- function Onflashget3Flv(event)
- {
- var obj
- try
- {
- const cid = "@flashget.com/FlashgetXpiEx;1";
- obj = Components.classes[cid].createInstance();
- obj = obj.QueryInterface(Components.interfaces.IFlashgetXpi);
- } catch (err) {
- return;
- }
-
- if ( obj == null )
- {
- return;
- }
-
- var strRef = document.commandDispatcher.focusedWindow.document.URL;
-
- obj.FlvDetector(strRef, "FlashGet3", 0);
- }
-
-