Полезная информация

Вы можете получить техническую поддержку и просто поболтать в jabber-конференциях Mozilla Россия: support@conference.mozilla-russia.org — для решения проблем с программами Mozilla, talks@conference.mozilla-russia.org — для общения на свободные темы.

№1337614-06-2019 19:24:14

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 150
UA: Firefox 66.0

Re: Custom Buttons

anywho

anywho пишет:

а хочу в папку TUBE, где сам  youtube.dl.exe....

Посмотри код кнопки в моем посте выше. Там закачка идет так, как ты хочешь.

Отсутствует

 

№1337714-06-2019 20:29:52

anywho
Забанен
 
Группа: Members
Зарегистрирован: 21-05-2019
Сообщений: 54
UA: Firefox 67.0

Re: Custom Buttons

Garalf
Ваша кнопка только уоutube качает, а моя весь MP4 поток , не только YT , теперь куда надо ...

Выделить код

Код:

custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3E%u0412%u0438%u0434%u0435%u043E%20c%20YuuTube.dl.exe%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bmoz-icon%3A//file%3A//D%3A%5Ctube%5Cyoutube-dl.exe.lnk%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B/*Initialization%20Code*/%0A%0Avar%20path%20%3D%20%27D%3A%5C%5Ctube%5C%5Cyoutube-dl.exe.lnk%27%0Avar%20addToPlaylistKey%20%3D%20%22/add%22%3B%0A%0Avar%20sysPlayerName%20%3D%20%22youtube-dl.exe%22%3B%0Avar%20openIn%20%3D%20%22%u0421%u043A%u0430%u0447%u0430%u0442%u044C%20%u0441%20%22+sysPlayerName%3B%0Avar%20videoMoved%20%3D%20%22%u0412%u0438%u0434%u0435%u043E%20%u043F%u0435%u0440%u0435%u043D%u0435%u0441%u0435%u043D%u043E%20%u0432%20%22+sysPlayerName%3B%0Avar%20noFound%20%3D%20%22%u041D%u0435%20%u043D%u0430%u0439%u0434%u0435%u043D%u043E%20%u0432%u0438%u0434%u0435%u043E%20%u043D%u0430%20%u0441%u0442%u0440%u0430%u043D%u0438%u0446%u0435%2C%20%u0434%u043E%u0441%u0442%u0443%u043F%u043D%u043E%u0435%20%u0434%u043B%u044F%20%u043F%u0435%u0440%u0435%u043D%u043E%u0441%u0430%20%u0432%20%22+sysPlayerName%3B%0A%0Avar%20Menu_n_TooltipTxts%20%3D%20%5B%7B%0Alabel%3A%20%22%u0414%u0435%u0439%u0441%u0442%u0432%u0438%u0435%20%u043A%u043D%u043E%u043F%u043A%u0438%3A%20%u0417%u0430%u0433%u0440%u0443%u0437%u0438%u0442%u044C%20%u0432%u0438%u0434%u0435%u043E%20c%20%22+sysPlayerName%2C%0Aradio%3A%20%27%27%2C%0Avalue%3A%20%27videotoplayer%27%2C%0AtooltipTxt%3A%20%27%u0417%u0430%u0433%u0440%u0443%u0437%u0438%u0442%u044C%20%u0432%u0438%u0434%u0435%u043E%20c%20%27+sysPlayerName%0A%0A%0A%7D%2C%0A%5D%3B%0A%0Avar%20YoutubeID%20%3D%20/%28%3F%3Ayoutube%28%3F%3A-nocookie%29%3F%5C.com%5C/%28%3F%3A%5B%5E%5C/%5Cn%5Cs%5D+%5C/%5CS+%5C/%7C%28%3F%3Av%7Ce%28%3F%3Ambed%29%3F%29%5C/%7C%5CS*%3F%5B%3F%26%5Dv%3D%29%7Cyoutu%5C.be%5C/%29%28%5Ba-zA-Z0-9_-%5D%7B11%7D%29%28%3F%3A%5CW%7C%24%29/%3B%0A%0A%0A%0Aif%28%21%28cbu.getPrefs%28%22CB.video%22%29%29%20%7C%7C%20cbu.getPrefs%28%22CB.video%22%29.length%20%3C%209%29%20cbu.setPrefs%28%22CB.video%22%2C%20%22videotoplayer%22%29%3B%0Avar%20tmp%20%3D%20%27%27%2C%0Atmpp%20%3D%20%27%27%2C%0AinnerA%20%3D%20%27%3Cdiv%20style%3D%22display%3Ablock%21important%3Bcolor%3A%2300ff00%21important%3Bwidth%3A250px%21important%3Bfont%3Abold%2016px%20serif%21important%3Bz-index%3A999%21important%3Bopacity%3A1%21important%3Bvisibility%3A%20visible%21important%3B%27%2C%0AinnerB%20%3D%20%27left%3A5px%21important%3Bposition%3Aabsolute%21important%3Bheight%3Aauto%21important%3Bbox-sizing%3Aborder-box%21important%3Bpadding%3A5px%21important%3Bmargin%3A5px%21important%3B%27%2C%0AstopPl%20%3D%20%22javascript%3A%28function%28%29%7Bv%3Ddocument.getElementById%28%27movie_player%27%29%3Bif%28v%29%7Bv.stopVideo%28%29%7Delse%7Bv%3Ddocument.getElementsByTagName%28%27video%27%29%3Bif%28v%29%7Bv%5B0%5D.src%3D%27%27%3Btry%7Bv%5B0%5D.load%28%29%7Dcatch%28e%29%7B%7D%7D%3B%7D%7D%29%28%29%3B%22%2C%0AytIMGouter%20%3D%20function%28ytID%29%20%7Breturn%20%27%3Cdiv%20width%3D%22100%25%22%3E%3Cbr%20/%3E%3Ca%20target%3D%22_blank%22%20href%3D%22https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20ytID%20+%20%27%22%3E%3Cimg%20src%3D%22https%3A//i.ytimg.com/vi/%27%20+%20ytID%20+%20%27/hqdefault.jpg%22%3E%3C/a%3E%3Cbr%20/%3E%27%20+%20innerA%20+%20%27background-color%3Ablack%21important%3Bposition%3Arelative%21important%3Bbottom%3A20px%21important%3B%22%3E%26nbsp%3B%26nbsp%3B%27%20+%20videoMoved%20+%20%27%3C/div%3E%3Cbr%20/%3E%3C/div%3E%3Cbr%20/%3E%27%7D%2C%0AhandlWin%20%3D%20function%28currentWin%29%20%7B%0Atmp%20%3D%20%27%27%3B%0Avar%20elem%20%3D%20currentWin.document.getElementsByTagName%28%27video%27%29%2C%20currLoc%20%3D%20currentWin.location%3B%0Aif%28elem.length%20%3E%200%29%20%7B%0Aif%28currLoc.hostname.indexOf%28%27youtu%27%29%20%21%3D%20-1%20%26%26%20%28tmp%20%3D%20currLoc.toString%28%29.match%28YoutubeID%29%29%20%26%26%20tmp%5B1%5D.length%20%3D%3D%2011%29%20%7B%0Aplay%28cbu.getPrefs%28%22CB.video%22%29%20%3D%3D%20%22videotoplaylist%22%20%3F%20%27https%3A//www.youtube.com/embed/%27%20+%20tmp%5B1%5D%20%3A%20%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%3B%0AvideoMovedbox%20%3D%20currentWin.document.createElement%28%27videoMoved%27%29%3B%0AvideoMovedbox.innerHTML%20%3D%20innerA%20+%20innerB%20+%20%27top%3A-15px%21important%3B%22%3E%3Cb%3E%27%20+%20videoMoved%20+%20%27%3C/b%3E%3C/div%3E%27%3B%0AloadURI%28stopPl%29%3B%0AcurrentWin.document.getElementById%28%27eow-title%27%29.appendChild%28videoMovedbox%29%3B%0Areturn%20true%3B%0A%7D%3B%0Afor%28i%20%3D%200%3B%20i%20%3C%20elem.length%3B%20i++%29%20%7B%0Aif%28%28%28tmp%20%3D%20getSrc%28elem%5Bi%5D.parentNode%2C%20currLoc%29%29%20%26%26%20tmp.length%20%3E%202%29%20%7C%7C%20%28i%20%3D%3D%200%20%26%26%20currentWin.document.body.innerHTML.substring%280%2C%207%29%20%3D%3D%20%27%3Cvideo%20%27%20%26%26%20%28tmp%20%3D%20currLoc.toString%28%29%29%29%29%20%7B%0AvideoMovedbox%20%3D%20currentWin.document.createElement%28%27videoMoved%27%29%3B%0AvideoMovedbox.innerHTML%20%3D%20innerA%20+%20innerB%20+%20%27top%3A20px%21important%3Bbackground-color%3Ablack%21important%3B%22%3E%27%20+%20videoMoved%20+%20%27%3C/div%3E%27%3B%0Aplay%28tmp%29%3B%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%0Aif%28currLoc.hostname%20%3D%3D%20%27www.youtube.com%27%29%20%7B%0Aelem%5Bi%5D.parentNode.parentNode.appendChild%28videoMovedbox%29%3B%0A%7D%20else%20%7B%0Aelem%5Bi%5D.parentNode.appendChild%28videoMovedbox%29%3B%0A%7D%3B%0Aelem%5Bi%5D.src%20%3D%20%27%27%3B%0Atry%20%7B%0Aelem%5Bi%5D.load%28%29%0A%7D%20catch%28e%29%20%7B%7D%3B%0Areturn%20true%3B%0A%7D%0A%7D%0A%7D%3B%0A%0AcurrentWin._elems%20%3D%20currentWin.document.getElementsByTagName%28%27iframe%27%29%3B%0Aif%28currentWin._elems.length%20%3E%200%29%20%7B%0Afor%28currentWin._iCounter%20%3D%200%3B%20currentWin._iCounter%20%3C%20currentWin._elems.length%3B%20currentWin._iCounter++%29%20%7B%0Aif%28%28currentWin._elems%5BcurrentWin._iCounter%5D.src.indexOf%28%27youtube.com%27%29%20%3E%20-1%29%20%26%26%20%28tmp%20%3D%20currentWin._elems%5BcurrentWin._iCounter%5D.src.match%28YoutubeID%29%29%20%26%26%20%28tmp%5B1%5D.length%20%3D%3D%2011%29%29%20%7B%0Aplay%28cbu.getPrefs%28%22CB.video%22%29%20%3D%3D%20%22videotoplaylist%22%20%3F%20%27https%3A//www.youtube.com/embed/%27%20+%20tmp%5B1%5D%20%3A%20%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%3B%0AcurrentWin._elems%5BcurrentWin._iCounter%5D.outerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0Areturn%20true%3B%0A%7D%3B%0Aif%28currentWin._elems%5BcurrentWin._iCounter%5D.clientWidth%20%3E%2080%20%26%26%20currentWin._elems%5BcurrentWin._iCounter%5D.clientHeight%20%3E%2040%20%26%26%20handlWin%28currentWin._elems%5BcurrentWin._iCounter%5D.contentWindow%29%29return%20true%3B%0A%7D%0A%7D%3B%0A%0Aelem%20%3D%20currentWin.document.getElementsByTagName%28%27object%27%29%3B%0AcurrLoc%20%3D%20currentWin.location%3B%0Aif%28elem.length%20%3D%3D%200%29%20%7B%0Aelem%20%3D%20currentWin.document.getElementsByTagName%28%27embed%27%29%0A%7D%3B%0Aif%28elem.length%20%3E%200%29%20%7B%0Afor%28i%20%3D%200%3B%20i%20%3C%20elem.length%3B%20i++%29%20%7B%0Aif%28elem%5Bi%5D.innerHTML.indexOf%28%27youtu%27%29%20%21%3D%20-1%20%26%26%20%28tmp%20%3D%20elem%5Bi%5D.innerHTML.match%28YoutubeID%29%29%20%26%26%20tmp%5B1%5D.length%20%3D%3D%2011%29%20%7B%0Aplay%28cbu.getPrefs%28%22CB.video%22%29%20%3D%3D%20%22videotoplaylist%22%20%3F%20%27https%3A//www.youtube.com/embed/%27%20+%20tmp%5B1%5D%20%3A%20%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%3B%0Aelem%5Bi%5D.outerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0Areturn%20true%3B%0A%7D%20else%20%7B%0Aif%28elem%5Bi%5D.clientWidth%20%3E%2080%20%26%26%20elem%5Bi%5D.clientHeight%20%3E%2040%29%20%7B%0Aif%28%28%28tmp%20%3D%20getSrc%28elem%5Bi%5D.parentNode%2C%20currLoc%29%29%20%7C%7C%20%28tmp%20%3D%20getLink%28elem%5Bi%5D%2C%20currLoc%29%29%29%20%26%26%20tmp.length%20%3E%202%29%20%7B%0Aplay%28tmp%29%3B%0Aelem%5Bi%5D.outerHTML%20%3D%20innerA%20+%20%27background-color%3Ablack%21important%3Bbottom%3A20px%21important%3B%22%3E%26nbsp%3B%26nbsp%3B%27%20+%20videoMoved%20+%20%27%3C/div%3E%27%3B%0Areturn%20true%3B%0A%7D%3B%0A%7D%3B%0A%7D%0A%7D%3B%0A%7D%3B%0Areturn%20false%3B%0A%7D%3B%0A%0Athis.onclick%20%3D%20this.oncontextmenu%20%3D%20e%20%3D%3E%20%7B%0Aif%20%28e.target%20%21%3D%20this%29%20return%3B%0Aif%28e.button%20%3D%3D%200%29%20%7B%0Aif%28cbu.getPrefs%28%22CB.video%22%29.substring%280%2C6%29%20%3D%3D%20%22videom%22%29%7B%0Aelem%20%3D%20content.document.getElementsByTagName%28%27object%27%29%3B%0Aif%28elem.length%20%3D%3D%200%29%20%7B%0Aelem%20%3D%20content.document.getElementsByTagName%28%27embed%27%29%0A%7D%3B%0A%0AresizeObjs%28elem%29%3B%0AresizeObjs%28content.document.getElementsByTagName%28%27iframe%27%29%29%3B%0AresizeObjs%28content.document.getElementsByTagName%28%27video%27%29%29%3B%0A%7D%20else%20%7B%0Aif%28%21handlWin%28content%29%29custombuttons.alertSlide1%28noFound%29%3B%0A%7D%0A%7D%3B%0A%0Aif%28e.button%20%3D%3D%201%29%0AgShowPopup%28self%29%3B%0A%0Aif%28e.button%20%3D%3D%202%20%26%26%20%21e.ctrlKey%20%26%26%20%21e.shiftKey%20%26%26%20%21e.altKey%20%26%26%20%21e.metaKey%29%20%7B%0Ae.preventDefault%28%29%3B%0Amenu.showPopup%28self%2C%20-1%2C%20-1%2C%20%22popup%22%2C%20%22bottomleft%22%2C%20%22topleft%22%29%3B%0A%7D%0A%7D%3B%0Athis.oncontextmenu%20%3D%20e%20%3D%3E%20e.target%20%21%3D%20this%20%3F%20menu.hasAttribute%28%22context%22%29%0A%20%20%20%20%3A%20e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%20%7C%7C%20e.metaKey%20%7C%7C%20%28%0A%20%20%20%20%20%20%20%20e.detail%20%21%3D%201%20%3F%20menu.hidePopup%28%29%20%3A%20%21%21menu.openPopup%28this%2C%20%22after_start%22%29%0A%20%20%20%20%29%3B%0Acustombuttons.alertSlide1%20%3D%20function%28sTitle%29%20%7B%0Avar%20as%20%3D%20Components.classes%5B%22@mozilla.org/alerts-service%3B1%22%5D.getService%28Components.interfaces.nsIAlertsService%29%3B%0Aas.showAlertNotification%28%27chrome%3A//global/skin/icons/information-16.png%27%2C%20%22%22%2C%20sTitle%2C%20false%2C%20%22%22%2C%20null%29%3B%0AsetTimeout%28%28%29%20%3D%3E%20as.closeAlert%28%29%2C%20999%29%3B%0A%7D%3B%0A%0Afunction%20resizeObjs%28objs%29%20%7B%0Aif%28%21objs%29%20return%3B%0ALEVELS%20%3D%203%3B%0Adir%20%3D%20%28cbu.getPrefs%28%22CB.video%22%29%20%3D%3D%20%22videomaximize%22%29%20%3F%201%20%3A%20-1%3B%0Afor%28i%20%3D%200%3B%20i%20%3C%20objs.length%3B%20i++%29%20%7B%0Avar%20Width%20%3D%20new%20Array%28LEVELS%29%0Avar%20Height%20%3D%20new%20Array%28LEVELS%29%0AWidth%5B0%5D%20%3D%20objs%5Bi%5D.clientWidth%3B%0AHeight%5B0%5D%20%3D%20objs%5Bi%5D.clientHeight%3B%0Aif%28%28Width%5B0%5D%20%3E%20%28-20%20*%20dir%20+%20100%29%29%20%26%26%20%28Height%5B0%5D%20%3E%20%28-20%20*%20dir%20+%2060%29%29%29%20%7B%0Aobj%20%3D%20objs%5Bi%5D%3B%0Afor%28var%20k%20%3D%201%3B%0A%28%28k%20%3C%20LEVELS%29%20%26%26%20%28obj.parentNode%29%29%3B%20k++%29%20%7B%0Aobj%20%3D%20obj.parentNode%0AWidth%5Bk%5D%20%3D%20obj.clientWidth%3B%0AHeight%5Bk%5D%20%3D%20obj.clientHeight%3B%0A%7D%3B%0AWidth%5B0%5D%20%3D%20Width%5B0%5D%20+%20dir%20*%20%28Width%5B0%5D%20/%205%20%7C%200%29%3B%0AHeight%5B0%5D%20%3D%20Height%5B0%5D%20+%20dir%20*%20%28Height%5B0%5D%20/%205%20%7C%200%29%3B%0Aobjs%5Bi%5D.style.width%20%3D%20Width%5B0%5D%20+%20%22px%22%3B%0Aobjs%5Bi%5D.width%20%3D%20Width%5B0%5D%3B%0Aobjs%5Bi%5D.style.height%20%3D%20Height%5B0%5D%20+%20%22px%22%3B%0Aobjs%5Bi%5D.height%20%3D%20Height%5B0%5D%3B%0Aobj%20%3D%20objs%5Bi%5D%3B%0Afor%28var%20k%20%3D%201%3B%0A%28%28k%20%3C%20LEVELS%29%20%26%26%20%21%28objs%5Bi%5D.tagName%20%3D%3D%20%27IFRAME%27%29%20%26%26%20%28obj.parentNode%29%20%26%26%20%28Width%5Bk%5D%29%20%26%26%20%28Height%5Bk%5D%29%20%26%26%20%28Width%5Bk%5D%20%3E%20%28-20%20*%20dir%20+%20100%29%29%20%26%26%20%28Height%5Bk%5D%20%3E%20%28-20%20*%20dir%20+%2060%29%29%29%3B%20k++%29%20%7B%0Aobj%20%3D%20obj.parentNode%0AWidth%5Bk%5D%20%3D%20Width%5Bk%5D%20+%20dir%20*%20%28Width%5Bk%5D%20/%205%20%7C%200%29%3B%0AHeight%5Bk%5D%20%3D%20Height%5Bk%5D%20+%20dir%20*%20%28Height%5Bk%5D%20/%205%20%7C%200%29%3B%0Aobj.style.width%20%3D%20Width%5Bk%5D%20+%20%22px%22%3B%0Aobj.width%20%3D%20Width%5Bk%5D%3B%0Aobj.style.height%20%3D%20Height%5Bk%5D%20+%20%22px%22%3B%0Aobj.height%20%3D%20Height%5Bk%5D%3B%0A%7D%0A%7D%0A%7D%3B%0A%7D%3B%0A%0Afunction%20restProtHost%28lnkR%2C%20curLoc%29%20%7B%0Aif%28lnkR.length%3D%3D0%29return%20%27%27%3B%0Alet%20tr%20%3D%20lnkR.replace%28/%5E%3A%5C/%5C//%2C%20curLoc.protocol%20+%20%22//%22%29%3B%0Aif%28%21tr.match%28/%5Ehttps%3F%3A%5C/%5C//i%29%29%7B%0AlnkR%20%3D%20tr.replace%28/%5E%5C/+/%2C%20%27%27%29%3B%0Aif%28lnkR.split%28%27/%27%29%5B0%5D.split%28%27%3F%27%29%5B0%5D.split%28%27%23%27%29%5B0%5D.toLowerCase%28%29.match%28/%5E%28%3F%3A%5B-a-z%5Cd%5D+%5C.%29+%5Ba-z%5Cd%5D%7B2%2C6%7D%24/%29%29%7B%0Atr%20%3D%20curLoc.protocol%20+%20%27//%27%20+%20lnkR%3B%0A%7Delse%7B%0Atr%20%3D%20curLoc.protocol%20+%20%27//%27%20+%20curLoc.host%20+%20%22/%22%20+%20lnkR%3B%0A%7D%0A%7D%3B%0Areturn%20tr%3B%0A%7D%3B%0A%0Afunction%20getSrc%28vobj%2C%20currentLoc%29%20%7B%0Avar%20t%20%3D%20%27%27%2C%0Att%20%3D%20%27%27%3B%0Aif%28%28%28%28t%20%3D%20vobj.innerHTML.match%28/%3Cvideo.*%3F%5Cssrc%3D%28%3F%3A%28%3F%3A%27%28%5B%5E%27%5D*%29%27%29%7C%28%3F%3A%22%28%5B%5E%22%5D*%29%22%29%7C%28%5B%5E%5Cs%5D*%29%29/i%29%29%20%26%26%20%28t%29%20%26%26%20%28tt%20%3D%20t%5B1%5D%20%7C%7C%20t%5B2%5D%20%7C%7C%20t%5B3%5D%29%20%26%26%20tt.indexOf%28%27blob%3A%27%29%20%3D%3D%20-1%20%29%20%7C%7C%20%28%28t%20%3D%20vobj.innerHTML.match%28/%3Csource.*%3F%5Cssrc%3D%28%3F%3A%28%3F%3A%27%28%5B%5E%27%5D*%29%27%29%7C%28%3F%3A%22%28%5B%5E%22%5D*%29%22%29%7C%28%5B%5E%5Cs%5D*%29%29.*%3F%5Cstype%3D%5B%27%22%5D%3Fvideo%5C//i%29%29%20%26%26%20%28t%29%20%26%26%20%28tt%20%3D%20t%5B1%5D%20%7C%7C%20t%5B2%5D%20%7C%7C%20t%5B3%5D%29%29%29%20%26%26%20tt.length%20%3E%202%20%26%26%20tt.indexOf%28%27blob%3A%27%29%20%3D%3D%20-1%20%29%20%7B%0Aif%28tt.indexOf%28%22.mp4/%3F%22%29%20%3D%3D%20-1%29%20%7B%0Att%20%3D%20tt.replace%28/%26amp%3B/g%2C%20%22%26%22%29%0A%7D%3B%0At%20%3D%20restProtHost%28tt%2C%20currentLoc%29%3B%0Areturn%20t%3B%0A%7D%3B%0Areturn%20%27%27%3B%0A%7D%3B%0A%0Afunction%20getLink%28obj%2C%20curLocation%29%20%7B%0A%0A%0Aif%28%21obj%20%7C%7C%20%21obj.tagName%29%20return%20%27%27%3B%0Avar%20flashvars%20%3D%20%27%27%2C%0A//%20%20%20%20%20%20%20%20src%20%3D%20%27%27%2C%0Aq%20%3D%20obj.tagName.toLowerCase%28%29%3B%0A%0Avar%20getParam%20%3D%20function%28e%2C%20n%29%20%7B%0Avar%20v%20%3D%20%27%27%2C%0Ar%20%3D%20new%20RegExp%28%27%5E%28%27%20+%20n%20+%20%27%29%24%27%2C%20%27i%27%29%2C%0Aparam%20%3D%20e.getElementsByTagName%28%27param%27%29%3B%0Afor%28var%20igp%20%3D%200%2C%20p%3B%20p%20%3D%20param%5Bigp%5D%3B%20igp++%29%20%7B%0Aif%28p.hasAttribute%28%27name%27%29%20%26%26%20p.getAttribute%28%27name%27%29.match%28r%29%29%20%7B%0Av%20%3D%20p.getAttribute%28%27value%27%29%3B%0Abreak%0A%7D%3B%0A%7D%3B%0Areturn%20v%3B%0A%7D%3B%0A%0A%0Aif%28q%20%3D%3D%20%27object%27%29%20%7B%0A//%20%20%20%20%20%20%20%20src%20%3D%20obj.getAttribute%28%27data%27%29%20%7C%7C%20obj.getAttribute%28%27src%27%29%20%7C%7C%20getParam%28obj%2C%20%27movie%7Cdata%7Csrc%7Ccode%7Cfilename%7Curl%27%29%20%7C%7C%20%28obj.getElementsByTagName%28%27embed%27%29.length%20%3E%200%20%3F%20obj.getElementsByTagName%28%27embed%27%29%5B0%5D.getAttribute%28%27src%27%29%20%3A%20%27%27%29%3B%0Aflashvars%20%3D%20getParam%28obj%2C%20%27flashvars%27%29%3B%0A%7D%20else%20if%28q%20%3D%3D%20%27embed%27%29%20%7B%0A//%20%20%20%20%20%20%20%20src%20%3D%20obj.getAttribute%28%27src%27%29%3B%0Aflashvars%20%3D%20obj.getAttribute%28%27flashvars%27%29%3B%0A%7D%20else%20return%20%27%27%3B%0A%0A%0Aif%28%21flashvars%29%20return%20%27%27%3B%0A//%20%20%20src%20%3D%20restProtHost%28src%2C%20curLocation%29%3B%0A%0Avar%20restPath%20%3D%20function%28f%2C%20s%29%20%7B%0Areturn%28f.substring%280%2C%204%29%20%3D%3D%20%27http%27%29%20%3F%20f%20%3A%20s.replace%28/%5B%23%3F%5D.*%24/%2C%20%27%27%29.replace%28/%5B%5E%5C/%5D*%24/%2C%20f%29%0A%7D%3B%0A%0Afunction%20videoLinkExtract%28fl%29%20%7B%0A//alert%28fl%29%3B%0Avar%20linkArr%20%3D%20%5B%5D%2C%0AoutLinks%20%3D%20%5B%5D%2C%0Ajj%20%3D%200%2C%0Alba%20%3D%20%27%27%2C%0Albb%20%3D%20%27%27%2C%0AdecodeURL%20%3D%20function%28s%29%20%7B%0Atry%20%7B%0Areturn%20decodeURIComponent%28s%29%0A%7D%20catch%28e%29%20%7B%0Areturn%20unescape%28s%29%0A%7D%0A%7D%3B%0A%0Afor%28var%20ij%20%3D%200%3B%20ij%20%3C%203%3B%20ij++%29%20%7B%0Alba%20%3D%20lba%20+%20String.fromCharCode%28parseInt%28%28Math.random%28%29%20*%2015%20+%201%29%20+%20%27%27%2C%2010%29%29%3B%0Albb%20%3D%20lbb%20+%20String.fromCharCode%28parseInt%28%28Math.random%28%29%20*%2015%20+%2016%29%20+%20%27%27%2C%2010%29%29%3B%0A%7D%3B%0A%0Afunction%20pushWithMerit%28lnk%29%20%7B%0A%0Avar%20merit%20%3D%20-11%3B%0Aif%28lnk.match%28/%5Ehttps%3F%3A%5C/%5C//i%29%29%20merit%20%3D%20merit%20+%2040%3B%0Aif%28outLinks.length%20%3D%3D%200%29%20merit%20%3D%20merit%20+%201%3B%0Aif%28lnk.match%28/%5E%5C//%29%29%20merit%20%3D%20merit%20+%207%3B%0Aif%28lnk.match%28/%5E%5C/%5C//%29%29%20merit%20%3D%20merit%20+%2030%3B%0Aif%28lnk.match%28/240p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%201%3B%0Aif%28lnk.match%28/%5B%5Ea-z%5D240%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%201%3B%0Aif%28lnk.match%28/360p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%203%3B%0Aif%28lnk.match%28/%5B%5Ea-z%5D360%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%203%3B%0Aif%28lnk.match%28/480p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%205%3B%0Aif%28lnk.match%28/%5B%5Ea-z%5D480%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%205%3B%0Aif%28lnk.match%28/720p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%207%3B%0Aif%28lnk.match%28/%5B%5Ea-z%5D720%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%207%3B%0Aif%28lnk.match%28/%5C.mp4%28%5B%5Ea-z%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%208%3B%0Aif%28lnk.match%28/_hd%28%5B%5Ea-z%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20+%206%3B%0Aif%28lnk.match%28/%5C.%28jpg%7Cxml%29%28%5B%5Ea-z%5D%7C%24%29/i%29%29%20merit%20%3D%20merit%20-%2040%3B%0Aif%28merit%20%3E%200%29%20outLinks.push%28merit%20+%20lba%20+%20lnk%29%3B%0AServices.console.logStringMessage%28%27merit%3A%27+merit+%27%20lnk-%3E%27+lnk%29%3B%0A%7D%3B%0A%0AlinkArr.push%28fl%29%3B%0Awhile%28linkArr.length%20%3E%20jj%20%26%26%20jj%20%3C%2030%29%20%7B%0A%0Avar%20testPaths%20%3D%20%5B%5D%3B%0AtestPaths%20%3D%20linkArr%5Bjj%5D.split%28/%28%5C.%28%3F%3Aflv%7Cmp4%7Cm3u8%29%29/i%29%3B%0Aif%28testPaths%5BtestPaths.length%20-%201%5D%20%3D%3D%20%27%27%29%20testPaths.pop%28%29%3B%0A%0Afor%28k%20%3D%201%3B%20k%20%3C%20testPaths.length%3B%20k%20%3D%20k%20+%202%29%20%7B%0A%0Aif%28testPaths%5Bk%20-%201%5D.indexOf%28lba%29%20%3E%20-1%29%20%7B%0Apref%20%3D%20testPaths%5Bk%20-%201%5D%3B%0A%7D%20else%20%7B%0Avar%20testAboutDom%20%3D%20testPaths%5Bk%20-%201%5D.toLowerCase%28%29.split%28/%28https%3F%3A%5C/%5C/%29/%29%3B%20%0Aif%28testAboutDom%5BtestAboutDom.length%20-%201%5D%3D%3D%27%27%29%20testAboutDom.pop%28%29%3B%0Avar%20pTest%20%3D%20testAboutDom%5BtestAboutDom.length%20-%201%5D.split%28/%28%5C%3F%5B%5E%5C%3F%5D*%3F%26%29/%29%3B%0Aif%28pTest.length%3E2%29%7B%0ApTest.pop%28%29%3B%0ApTest.pop%28%29%3B%0A%7D%3B%0AtestAboutDom%5BtestAboutDom.length%20-%201%5D%20%3D%20pTest.join%28%27%27%29%3B%0Apref%20%3D%20testPaths%5Bk%20-%201%5D.substring%28testAboutDom.join%28%27%27%29.lastIndexOf%28%22%26%22%29%20+%201%29%3B%0A%7D%3B%0A%0At2%20%3D%20pref.lastIndexOf%28lbb%29%3B%0Aif%28t2%20%3E%20-1%29%20%7B%0Apref%20%3D%20pref.substring%28t2%20+%203%29%3B%0A%7D%20else%20%7B%0A%0At2%20%3D%20pref.lastIndexOf%28%27%7B%22%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0At2%20%3D%20pref.lastIndexOf%28%27%5B%22%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0At2%20%3D%20pref.lastIndexOf%28%27%2C%22%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0At2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%22http%3A//%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0At2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%22https%3A//%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0At2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%2Chttp%3A//%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0At2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%2Chttps%3A//%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0At2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%3Bhttp%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0At2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27*https%3A//%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0At2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%20or%20%27%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%204%29%3B%0A%0Apref%20%3D%20pref.substring%28pref.split%28%27/%27%29%5B0%5D.toLowerCase%28%29.split%28%27%252f%27%29%5B0%5D.lastIndexOf%28%27%3D%27%29%20+%201%29%3B%0A%0A%7D%0A%0Aif%28pref.length%20%3E%200%29%20%7B%0A%0Aif%28pref.split%28%27%3F%27%29%5B0%5D.toLowerCase%28%29.match%28/%25%5B2-3%5D%5B0-9a-f%5D/%29%29%20%7B%0A%0At2%20%3D%20pref.indexOf%28%27%22%27%29%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0Asuff%20%3D%20testPaths%5Bk%20+%201%5D%20%3F%20testPaths%5Bk%20+%201%5D.split%28%27%26%27%29%5B0%5D.split%28%27%22%27%29%5B0%5D.split%28%27%3B%27%29%5B0%5D.split%28/%2Chttp/i%29%5B0%5D%20%3A%20%27%27%3B%0Aif%28%28suff%20%21%3D%20testPaths%5Bk%20+%201%5D%29%20%7C%7C%20%28testPaths.length%20%3C%20k%20+%203%29%29%20%7B%0Aif%28testPaths.length%20%3E%20k%20+%201%29%20%7B%0AtestPaths%5Bk%20+%201%5D%20%3D%20%28%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%29%20%3F%20%27%27%20%3A%20%27%26%27%29%20+%20testPaths%5Bk%20+%201%5D.substr%28suff.length%29%0A%7D%3B%0At2%20%3D%20pref.lastIndexOf%28lba%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%203%29%0AlinkArr.push%28decodeURL%28pref%20+%20testPaths%5Bk%5D%20+%20suff%29%29%3B%0A%0A%7D%20else%20%7B%0AtestPaths%5Bk%20+%201%5D%20%3D%20%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%20%3F%20%27%27%20%3A%20lbb%29%20+%20pref%20+%20testPaths%5Bk%5D%20+%20suff%0A%7D%0A%7D%20else%20%7B%0Asuff%20%3D%20testPaths%5Bk%20+%201%5D%20%3F%20testPaths%5Bk%20+%201%5D.split%28%27%3B%27%29%5B0%5D.split%28%27%22%5D%27%29%5B0%5D.split%28%27%22%7D%27%29%5B0%5D.split%28%27%22%2C%27%29%5B0%5D.split%28/%2Chttps%3F%3A%5C/%5C//i%29%5B0%5D.split%28%27*https%3A//%27%29%5B0%5D.split%28%27%20or%20%27%29%5B0%5D%20%3A%20%27%27%3B%0At2%20%3D%20suff.indexOf%28%27%26%27%29%3B%0Aif%28%28t2%20%3E%20-1%29%20%26%26%20%28pref%20%21%3D%20testPaths%5Bk%20-%201%5D%29%29%20%7B%0Aif%28t2%20%3D%3D%200%29%20suff%20%3D%20%27%27%3B%0Aif%28suff.charAt%280%29%20%21%3D%20%27%3F%27%29%20suff%20%3D%20suff.split%28/%28%26%5B%5E%26%5D+%3Dhttps%3F%3A%5C/%5C/%29/i%29%5B0%5D%3B%0A%7D%3B%0Aif%28%28suff%20%21%3D%20testPaths%5Bk%20+%201%5D%29%20%7C%7C%20%28testPaths.length%20%3C%20k%20+%203%29%29%20%7B%0Aif%28testPaths.length%20%3E%20k%20+%201%29%20%7B%0AtestPaths%5Bk%20+%201%5D%20%3D%20%28%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%29%20%3F%20%27%27%20%3A%20%27%26%27%29%20+%20testPaths%5Bk%20+%201%5D.substr%28suff.length%29%0A%7D%3B%0At2%20%3D%20pref.lastIndexOf%28lba%29%3B%0Aif%28t2%20%3E%20-1%29%20pref%20%3D%20pref.substring%28t2%20+%203%29%3B%0ApushWithMerit%28pref%20+%20testPaths%5Bk%5D%20+%20suff%29%3B%0A%0A%7D%20else%20%7B%0AtestPaths%5Bk%20+%201%5D%20%3D%20lba%20+%20%28pref%20%3D%3D%20testPaths%5Bk%20-%201%5D%20%3F%20%27%27%20%3A%20lbb%29%20+%20pref%20+%20testPaths%5Bk%5D%20+%20suff%0A%7D%0A%7D%0A%7D%0A%7D%3B%0Ajj%20%3D%20jj%20+%201%3B%0A%7D%3B%0A%0Aif%28outLinks.length%20%3D%3D%200%29%20return%20%27%27%3B%0Afunction%20srt%28a%2C%20b%29%20%7B%0Aa%20%3D%20parseInt%28a.substr%280%2C%20a.indexOf%28lba%29%29%2C%2010%29%3B%0Ab%20%3D%20parseInt%28b.substr%280%2C%20b.indexOf%28lba%29%29%2C%2010%29%3B%0Aif%28a%20%3C%20b%29%20return%201%3B%0Aif%28a%20%3E%20b%29%20return%20-1%3B%0Areturn%200%0A%7D%3B%0AoutLinks.sort%28srt%29%3B%0AoutLinks%5B0%5D%20%3D%20outLinks%5B0%5D.substr%28outLinks%5B0%5D.indexOf%28lba%29%20+%203%29%0Aif%28outLinks%5B0%5D.indexOf%28%27_hq.mp4/%3Ftime%3D%27%29%20%3E%200%29%20outLinks%5B0%5D%20%3D%20outLinks%5B0%5D.replace%28/%26/g%2C%20%27%26amp%3B%27%29%3B%0Areturn%20outLinks%5B0%5D%3B%0A%7D%3B%0Aol%20%3D%20videoLinkExtract%28flashvars%29%3B%0Aif%28%21ol%29%20return%20%27%27%3B%0A//%20%20%20%20ol%20%3D%20ol.replace%28/%5E%3A%3F%5C/%5C//%2C%20curLocation.protocol%20+%20%22//%22%29%3B%0A//%20%20%20%20return%20restPath%28ol%2C%20src%29%3B%0Areturn%20restProtHost%28ol%2C%20curLocation%29%3B%0A%7D%3B%0A%0A%0Avar%20menu%20%3D%20self.appendChild%28document.createElement%28%22menupopup%22%29%29%3B%0Aself.image%20%3D%20%22moz-icon%3A//file%3A//%22%20+%20path%3B%0Avar%20playerName%20%3D%20path.split%28%22%5C%5C%22%29.pop%28%29.replace%28%22.exe%22%2C%22%22%29%3B%0Aself.label%20%3D%20%22%u0421%u043A%u0430%u0447%u0430%u0442%u044C%20%u0441%20%22%20+sysPlayerName%3B%0AsetTimeout%28%28%29%20%3D%3E%20%7B%0AMenu_n_TooltipTxts.forEach%28%28m%29%20%3D%3E%20%7B%0Aif%28%22separator%22%20in%20m%29%20%7B%0Amenu.appendChild%28document.createElement%28%22menuseparator%22%29%29%3B%0Areturn%0A%7D%3B%0Avar%20mItem%20%3D%20document.createElement%28%22menuitem%22%29%3B%0AmItem.setAttribute%28%22label%22%2C%20m.label%29%3B%0A%0Aif%28%22radio%22%20in%20m%29%20%7B%0AmItem.setAttribute%28%22type%22%2C%20%22radio%22%29%3B%0AmItem.setAttribute%28%27checked%27%2C%20cbu.getPrefs%28%22CB.video%22%29%20%3D%3D%20m.value%29%3B%0Aif%28cbu.getPrefs%28%22CB.video%22%29%20%3D%3D%20m.value%29%20%7B%0Aself.tooltipText%20%3D%20m.tooltipTxt%3B%0A%7D%0AmItem.onclick%20%3D%20%28%29%20%3D%3E%20%7B%0Acbu.setPrefs%28%22CB.video%22%2C%20m.value%29%3B%0Atmp%20%3D%20%28self.image%20%3D%3D%20imgFlashToPlayer%20%7C%7C%20self.image%20%3D%3D%20imgFlashMinimize%20%7C%7C%20%20self.image%20%3D%3D%20imgFlashMaximize%29%3B%0Aif%28m.value.substring%280%2C9%29%3D%3D%27videotopl%27%29%7B%0Aself.image%20%3D%20tmp%20%3F%20imgFlashToPlayer%20%3A%20imgHTML5ToPlayer%3B%0A%7D%20else%20if%28m.value%3D%3D%27videominimize%27%29%20%7B%0Aself.image%20%3D%20tmp%20%3F%20imgFlashMinimize%20%3A%20imgHTML5Minimize%3B%0A%7D%20else%20self.image%20%3D%20tmp%20%3F%20imgFlashMaximize%20%3A%20imgHTML5Maximize%3B%0Aself.tooltipText%20%3D%20m.tooltipTxt%3B%0A%7D%3B%0A%7D%0Aif%28%22checkbox%22%20in%20m%29%20%7B%0AmItem.setAttribute%28%27type%27%2C%20%27checkbox%27%29%3B%0AmItem.setAttribute%28%27checked%27%2C%20%28self.image%20%3D%3D%20imgFlashToPlayer%20%7C%7C%20self.image%20%3D%3D%20imgFlashMinimize%20%7C%7C%20%20self.image%20%3D%3D%20imgFlashMaximize%20%29%29%3B%0AmItem.onclick%20%3D%20function%28e%29%20%7B%0Ae.stopPropagation%28%29%3B%0Ae.preventDefault%28%29%3B%0Aif%28e.button%20%3D%3D%200%29%20toggleFlash%28%29%3B%0A%7D%0A%7D%0Amenu.appendChild%28mItem%29%3B%0A%7D%29%3B%0Amenu.onclick%20%3D%20function%28e%29%20%7B%0Ae.stopPropagation%28%29%3B%0Aif%28e.button%20%3E%200%29%20e.preventDefault%28%29%3B%0A%7D%3B%0A%7D%2C%20100%29%3B%0Avar%20contextMenu%20%3D%20document.getElementById%28%22contentAreaContextMenu%22%29%3B%20%0Avar%20menuitem%20%3D%20contextMenu.insertBefore%28document.createElement%28%22menuitem%22%29%2C%20document.getElementById%28%22context-sep-open%22%29%29%3B%0Amenuitem.setAttribute%28%22label%22%2C%20%22%u0421%u043A%u0430%u0447%u0430%u0442%u044C%20%u0441%20%22%20+sysPlayerName%29%3B%20%20%20%20%20%20%0Amenuitem.setAttribute%28%22class%22%2C%20%22menuitem-iconic%22%29%3B%0Amenuitem.setAttribute%28%22image%22%2C%20%22moz-icon%3A//file%3A//%22%20+%20path%29%3B%20%0Amenuitem.onclick%20%3D%20%28%29%20%3D%3E%20play%28gContextMenu.linkURL%29%3B%0AaddEventListener%28%22popupshowing%22%2C%20%28%29%3D%3E%20menuitem.hidden%20%3D%20%21gContextMenu.onLink%2C%20false%2C%20contextMenu%29%3B%0AaddDestructor%28%28%29%3D%3E%20menuitem.remove%28%29%20%29%3B%0Avar%20contextMenu%20%3D%20document.getElementById%28%22contentAreaContextMenu%22%29%3B%0Avar%20mItem%20%3D%20contextMenu.insertBefore%28document.createElement%28%22menuitem%22%29%2C%20document.getElementById%28%22context-copyvideourl%22%29%29%3B%0AmItem.setAttribute%28%22label%22%2C%20openIn%29%3B%0AmItem.onclick%20%3D%20%28%29%20%3D%3E%20%7B%0Avar%20vurl%20%3D%20gContextMenu.mediaURL%2C%20videoelem%20%3D%20gContextMenu.target%3B%0Aif%28videoelem%20%26%26%20videoelem.nodeName.toLowerCase%28%29%20%3D%3D%20%27video%27%29%20%7B%0Aif%28content.location.hostname.indexOf%28%27youtu%27%29%20%21%3D%20-1%20%26%26%20%28tmp%20%3D%20content.location.toString%28%29.match%28YoutubeID%29%29%20%26%26%20tmp%5B1%5D.length%20%3D%3D%2011%29%20%7B%0Aplay%28vurl%29%3B%0AvideoMovedbox%20%3D%20content.document.createElement%28%27videoMoved%27%29%3B%0AvideoMovedbox.innerHTML%20%3D%20innerA%20+%20innerB%20+%20%27top%3A-15px%21important%3B%22%3E%3Cb%3E%27%20+%20videoMoved%20+%20%27%3C/b%3E%3C/div%3E%27%3B%0AloadURI%28stopPl%29%3B%0Acontent.document.getElementById%28%27eow-title%27%29.appendChild%28videoMovedbox%29%3B%0Areturn%3B%0A%7D%3B%0Aif%28content.location.hostname%20%3D%3D%20%27www.youtube.com%27%29%20%7B%0Avideoelem.parentNode.parentNode.appendChild%28videoMovedbox%29%3B%0A%7D%20else%20%7B%0Avar%20inFrameHref%20%3D%20inFrameWin.location.href%2C%20found%20%3D%20false%3B%0Aif%28inFrameWin.location.hostname%20%3D%3D%20%27www.youtube.com%27%20%26%26%20%28tmp%20%3D%20inFrameHref.match%28YoutubeID%29%29%20%26%26%20tmp%5B1%5D.length%20%3D%3D%2011%29%7B//%u0438%20%u0437%u043D%u0430%u0447%u0438%u0442%20%u0432%u043E%20%u0444%u0440%u0435%u0439%u043C%u0435%0Aelem%20%3D%20inFrameWin.parent.document.getElementsByTagName%28%27iframe%27%29%3B%0Aif%28elem.length%20%3E%200%29%20%7B%0Afor%28i%20%3D%200%3B%20i%20%3C%20elem.length%3B%20i++%29%20%7B%0Aif%28elem%5Bi%5D.contentWindow%20%3D%3D%20inFrameWin%29%20%7B%0Aelem%5Bi%5D.outerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0Afound%20%3D%20true%3B%0Abreak%3B%0A%7D%3B%0A%7D%3B%0A%7D%3B%0Aif%28%21found%29inFrameWin.document.body.innerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0Areturn%3B%0A%7D%3B%0Avideoelem.parentNode.appendChild%28videoMovedbox%29%3B%0A%7D%3B%0Avideoelem.src%20%3D%20%27%27%3B%0Atry%20%7B%0Avideoelem.load%28%29%0A%7D%20catch%28e%29%20%7B%7D%3B%0A%7D%20else%20play%28vurl%29%3B%0A%7D%3B%0A%0A%0AaddEventListener%28%22popupshowing%22%2C%20%28%29%20%3D%3E%20%7B%0AmItem.hidden%20%3D%20%21gContextMenu.onVideo%20%7C%7C%20%21gContextMenu.mediaURL%3B%0AmItem2.hidden%20%3D%20%21gContextMenu.linkURL%3B%0AmItem3.hidden%20%3D%20framItem.hidden%20%7C%7C%20gContextMenu.target.ownerDocument.location.hostname.indexOf%28%27youtube.com%27%29%20%3D%3D%20-1%3B%0A%7D%2C%20false%2C%20contextMenu%29%3B%0AaddDestructor%28%28%29%20%3D%3E%20%7BmItem.remove%28%29%3BmItem2.remove%28%29%3BmItem3.remove%28%29%7D%29%3B%0A%0Afunction%20play%28link%29%20%7B%0Avar%20file%20%3D%20Services.dirsvc.get%28%27CurProcD%27%2C%20Ci.nsIFile%29%3B%0Avar%20MozExeDir%20%3D%20file.path.split%28%27%5C%5C%27%29.slice%280%2C-1%29.join%28%27%5C%5C%27%29%3B%0Afile.initWithPath%28path%29%3B%0Aif%28%21file.exists%28%29%29%20%7B%0Acustombuttons.alertBox%28%22File%20not%20found%21%22%2C%20MozExeDir%20+%20Path%29%3B%0Areturn%3B%0A%7D%3B%0A%0Avar%20process%20%3D%20Cc%5B%22@mozilla.org/process/util%3B1%22%5D.createInstance%28Ci.nsIProcess%29%3B%0Aprocess.init%28FileUtils.File%28String.raw%60D%3A%5CTube%5Cyoutube-dl.exe.lnk%60%29%29%3B%0Aprocess.run%28false%2C%20%5Blink%2C%20cbu.getPrefs%28%22CB.video%22%29%20%3D%3D%20%22videotoplaylist%22%20%3F%20addToPlaylistKey%20%3A%20%22%22%5D%2C%202%29%3B%0A%7D%3B%0A%20%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E

Отредактировано anywho (14-06-2019 20:30:57)

Отсутствует

 

№1337814-06-2019 20:39:14

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 150
UA: Firefox 66.0

Re: Custom Buttons

anywho
Это понятно. Я имел ввиду, что скачивание идет в папку Tube.

Отсутствует

 

№1337914-06-2019 21:55:05

anywho
Забанен
 
Группа: Members
Зарегистрирован: 21-05-2019
Сообщений: 54
UA: Firefox 67.0

Re: Custom Buttons

Garalf
Надо бы эту фишку к плееру пристегнуть, только ярлык это что-то не работает...с этим

скрытый текст

Выделить код

Код:

$uUrl = Get-Clipboard
$YtDl = "<путь-до-youtube-dl>\youtube-dl.exe"
&$YtDl -F $uUrl
if (-Not $?) { exit }
$Choice = Read-Host -Prompt "Choose quality"
if ($Choice -eq "") { $Choice = "best" }
$uUrl = &$YtDl -g -f $Choice $uUrl
if (-Not $?) { exit }
&"<путь-до-potplayer>\PotPlayerMini64.exe" $uUrl 

Отсутствует

 

№1338014-06-2019 21:57:59

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 150
UA: Firefox 66.0

Re: Custom Buttons

anywho
Я так понял, что без ярлыка не качает.

Отредактировано Garalf (14-06-2019 22:35:30)

Отсутствует

 

№1338114-06-2019 22:23:20

anywho
Забанен
 
Группа: Members
Зарегистрирован: 21-05-2019
Сообщений: 54
UA: Firefox 67.0

Re: Custom Buttons

Garalf
Качает, ярлык просто значок имеет. Ковырять сам youtube.dl.exe  опасно

Отредактировано anywho (14-06-2019 22:25:59)

Отсутствует

 

№1338214-06-2019 22:36:39

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 150
UA: Firefox 66.0

Re: Custom Buttons

anywho пишет:

Надо бы эту фишку к плееру пристегнуть, только ярлык это что-то не работает...с этим

Ну так сделать как в первоисточнике - через powershell. Забить аргументы в ярлык и запустить его на выполнение, предварительно скопировав в буфер ссылку на видео.
Я пробовал - все работает.

Отредактировано Garalf (14-06-2019 22:39:48)

Отсутствует

 

№1338314-06-2019 23:44:55

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 931
UA: Firefox 52.0

Re: Custom Buttons

Garalf пишет:

копирование в clipboard, и запуск файла ярлыка

Ничего необычного

Выделить код

Код:

gClipboard.write(gContextMenu.linkURL);
FileUtils.File("C:\\Folder\\Sub\\ярлык.lnk").launch();

Во, кстати, можно проверить, будет ли работать без .ps1 и без ярлыка.
Просто запуск PowerShell, а скрипт как аргумент.
Вначале нужно прописать актуальные пути до приложений.

скрытый текст

Выделить код

Код:

(popup => addEventListener("popupshowing", {
    oncommand() {
        var ps = "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe";
        var pot = "C:\\PotPlayer\\PotPlayerMini.exe";
        var ytdl = "C:\\YouTube\\youtube-dl.exe";

        var script = `
            $uUrl = "${gContextMenu.linkURL}"
            $YtDl = "${ytdl}"
            &$YtDl -F $uUrl
            if (-Not $?) { exit }
            $Choice = Read-Host -Prompt "Choose quality"
            if ($Choice -eq "") { $Choice = "best" }
            $uUrl = &$YtDl -g -f $Choice $uUrl
            if (-Not $?) { exit }
            &"${pot}" $uUrl 
        `;
        var command = "";
        for(var ind = 0, len = script.length; ind < len; ind++) {
            var num = script.charCodeAt(ind);
            command += String.fromCharCode(num & 0xff, num >>> 8);
        }
        var args = ["-NoLogo", "-encodedCommand", btoa(command)];
        var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
        process.init(FileUtils.File(ps));
        process.runwAsync(args, args.length);
    },
    handleEvent(e) {
        if (e.target != popup || this.shouldHide) return;
        var menuitem = document.createXULElement("menuitem");
        for(var args of Object.entries({
            class: "menuitem-iconic",
            label: "Безымянный menuitem",
            oncommand: "linkedObject.oncommand();",
            image: "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAqnslYKp7JcmqeyX/qnsl/6p7Jf+qeyX/qnsl/6p7Jf+qeyX/qnsl/6p7Jf+qeyX/qnslyap7JWAAAAAAAAAAAKp7JcnQvJb/wql6/7+hb//Co2//xKNw/8mkb//MpW//0KRv/9Kkb//Uo2//1aZ1/9u7kf+rfCf/qnslAwAAAACqeyW9wad5/6Z/Of+idyj/pncr/6p6Kv+teCn/un0r/8GDM//FgzX/xHkw/8FwLf/SmWX/tYo9/6p7JSoAAAAAqnsljcOmcP+0kEf/uZVE/+HQp//Io1L/v480/8yeT//u3sD/8uLJ/+7XuP/u17j/y4pS/8ObV/+qeyVaAAAAAKp7JV2+mlr/vJlS/76WO//x6ND//Pjy/97Dgf/XrVf/7diw/+7atv/t0q7/7dKu/8aBRv/NqG7/qnsligAAAACqeyUttIo+/8GeWP+4iCr/yJ46/+jVo//+/fr/7dyw/9ilRf/SlDX/zIMu/8Z4Kf/Edjb/0qhy/6p7JboAAAAAqnslA6t8J//KrGv/u4kr/8KOKP/OnDT/4b9t//r05f/58d//3bBd/86KLP/IeCT/xHIs/9Wkb/+qeyXqAAAAAAAAAACqeyXM0LR6/8WcR//Glzf/zZk0/9OkOv/gvFr/+/Xo//z68//WmDX/zIIk/8d5J//TmmP/sYQz/6p7JRgAAAAAqnslnNCzef/Oq2D/zaNM/9SrUv/duGL/8uO9///////w3ar/26M+/9WUM//Pii//1Z5a/7+WTv+qeyVLAAAAAKp7JW/Kqmv/2r19/9ayZf/cvHP/7+C5///////16cn/5cFr/+G3Yv/hs1//3q9f/+G2ef/NrXH/rH0megAAAACqeyU8vZZN/+LLmP/dv37/69mw/////v/479n/58eA/+XCdf/lwXP/5b9z/+W9c//mwIL/27+N/65+J64AAAAAqnslD6+CL//r2bH/5MmO/+3bsf/16s7/6c6R/+fJh//oyYT/6MmG/+nHhf/oyYT/6cqL/+fQpf+ugCbaAAAAAAAAAACqeyWW172O/+7cuv/t2rT/7tu1/+3ZtP/v2rP/79uy/+/bsv/v27L/79uy/+/btP/o1LH/qnslzwAAAAAAAAAAqnslLap7JZaqeyX/qnsl/6p7Jf+qeyX/qnsl/6p7Jf+qeyX/qnsl/6p7Jf+qeyX/qnslz6p7JWYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA//+sQQADrEEAAaxBAAGsQQABrEEAAaxBAAGsQQABrEGAAKxBgACsQYAArEGAAKxBgACsQcAArEHAAKxB//+sQQ=="
        }))
            menuitem.setAttribute(...args);
        menuitem.linkedObject = this;
        popup.querySelector("#context-sep-open").before(menuitem);
        addDestructor(() => menuitem.remove());
        this.handleEvent = e => {
            if (e.target == popup) menuitem.hidden = this.shouldHide;
        }
    },
    get shouldHide() {
        return !(gContextMenu.onLink || gContextMenu.onPlainTextLink)
            || !/^https?:\/\//.test(gContextMenu.linkURL);
    }
}, false, popup || 1))(document.getElementById("contentAreaContextMenu"));

Отсутствует

 

№1338415-06-2019 00:44:27

Garalf
Участник
 
Группа: Members
Зарегистрирован: 19-09-2017
Сообщений: 150
UA: Firefox 66.0

Re: Custom Buttons

Dumby
Просто нет слов!).
Ничего необычного, как всегда все пашет, как часы.

Отсутствует

 

№1338515-06-2019 11:06:09

anywho
Забанен
 
Группа: Members
Зарегистрирован: 21-05-2019
Сообщений: 54
UA: Firefox 67.0

Re: Custom Buttons

Dumby
Хорошо, но большого смысла не вижу . Если бы просто ссылку передавало в плеер и без выпадания консольки  этой , и не только из контекста...
Короче, закачивает почти все
, а мечта это "изменить действие кнопки"  - "закачка"  и "передача ссылки в плеер".
Это можно итак ,но желательно чтобы сам  youtube.dl и передавал...Вместо /add  - К, примеру, - просто "закачка" , ну , или наоборот...

скрытый текст

Выделить код

Код:

/*Initialization Code*/

var path = 'D:\\tube\\youtube-dl.exe.lnk'
var addToPlaylistKey = "/add";

var sysPlayerName = "youtube-dl.exe";
var openIn = "Cкачать в "+sysPlayerName;
var videoMoved = "Видео перенесено в "+sysPlayerName;
var noFound = "Не найдено видео на странице, доступное для переноса в "+sysPlayerName;

var Menu_n_TooltipTxts = [{
label: "Действие кнопки: Запустить видео сразу в плеер ",
radio: '',
value: 'videotoplayer',
tooltipTxt: 'Запустить видео сразу в '
},
{
label: "Действие кнопки: Загрузить видео с Youtube.dl ",
radio: '',
value: 'videotoplaylist',
tooltipTxt: 'Перенести видео  в плейлист '
},
];

var YoutubeID = /(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})(?:\W|$)/;



if(!(cbu.getPrefs("CB.video")) || cbu.getPrefs("CB.video").length < 9) cbu.setPrefs("CB.video", "videotoplayer");
var tmp = '',
tmpp = '',
innerA = '<div style="display:block!important;color:#00ff00!important;width:250px!important;font:bold 16px serif!important;z-index:999!important;opacity:1!important;visibility: visible!important;',
innerB = 'left:5px!important;position:absolute!important;height:auto!important;box-sizing:border-box!important;padding:5px!important;margin:5px!important;',
stopPl = "javascript:(function(){v=document.getElementById('movie_player');if(v){v.stopVideo()}else{v=document.getElementsByTagName('video');if(v){v[0].src='';try{v[0].load()}catch(e){}};}})();",
ytIMGouter = function(ytID) {return '<div width="100%"><br /><a target="_blank" href="https://www.youtube.com/watch?v=' + ytID + '"><img src="https://i.ytimg.com/vi/' + ytID + '/hqdefault.jpg"></a><br />' + innerA + 'background-color:black!important;position:relative!important;bottom:20px!important;">&nbsp;&nbsp;' + videoMoved + '</div><br /></div><br />'},
handlWin = function(currentWin) {
tmp = '';
var elem = currentWin.document.getElementsByTagName('video'), currLoc = currentWin.location;
if(elem.length > 0) {
if(currLoc.hostname.indexOf('youtu') != -1 && (tmp = currLoc.toString().match(YoutubeID)) && tmp[1].length == 11) {
play(cbu.getPrefs("CB.video") == "videotoplaylist" ? 'https://www.youtube.com/embed/' + tmp[1] : 'https://www.youtube.com/watch?v=' + tmp[1]);
videoMovedbox = currentWin.document.createElement('videoMoved');
videoMovedbox.innerHTML = innerA + innerB + 'top:-15px!important;"><b>' + videoMoved + '</b></div>';
loadURI(stopPl);
currentWin.document.getElementById('eow-title').appendChild(videoMovedbox);
return true;
};
for(i = 0; i < elem.length; i++) {
if(((tmp = getSrc(elem[i].parentNode, currLoc)) && tmp.length > 2) || (i == 0 && currentWin.document.body.innerHTML.substring(0, 7) == '<video ' && (tmp = currLoc.toString()))) {
videoMovedbox = currentWin.document.createElement('videoMoved');
videoMovedbox.innerHTML = innerA + innerB + 'top:20px!important;background-color:black!important;">' + videoMoved + '</div>';
play(tmp);                
if(currLoc.hostname == 'www.youtube.com') {
elem[i].parentNode.parentNode.appendChild(videoMovedbox);
} else {
elem[i].parentNode.appendChild(videoMovedbox);
};
elem[i].src = '';
try {
elem[i].load()
} catch(e) {};
return true;
}
}
};

currentWin._elems = currentWin.document.getElementsByTagName('iframe');
if(currentWin._elems.length > 0) {
for(currentWin._iCounter = 0; currentWin._iCounter < currentWin._elems.length; currentWin._iCounter++) {
if((currentWin._elems[currentWin._iCounter].src.indexOf('youtube.com') > -1) && (tmp = currentWin._elems[currentWin._iCounter].src.match(YoutubeID)) && (tmp[1].length == 11)) {
play(cbu.getPrefs("CB.video") == "videotoplaylist" ? 'https://www.youtube.com/embed/' + tmp[1] : 'https://www.youtube.com/watch?v=' + tmp[1]);
currentWin._elems[currentWin._iCounter].outerHTML = ytIMGouter(tmp[1]);
return true;
};
if(currentWin._elems[currentWin._iCounter].clientWidth > 80 && currentWin._elems[currentWin._iCounter].clientHeight > 40 && handlWin(currentWin._elems[currentWin._iCounter].contentWindow))return true;
}
};

elem = currentWin.document.getElementsByTagName('object');
currLoc = currentWin.location;
if(elem.length == 0) {
elem = currentWin.document.getElementsByTagName('embed')
};
if(elem.length > 0) {
for(i = 0; i < elem.length; i++) {
if(elem[i].innerHTML.indexOf('youtu') != -1 && (tmp = elem[i].innerHTML.match(YoutubeID)) && tmp[1].length == 11) {
play(cbu.getPrefs("CB.video") == "videotoplaylist" ? 'https://www.youtube.com/embed/' + tmp[1] : 'https://www.youtube.com/watch?v=' + tmp[1]);
elem[i].outerHTML = ytIMGouter(tmp[1]);
return true;
} else {
if(elem[i].clientWidth > 80 && elem[i].clientHeight > 40) {
if(((tmp = getSrc(elem[i].parentNode, currLoc)) || (tmp = getLink(elem[i], currLoc))) && tmp.length > 2) {
play(tmp);
elem[i].outerHTML = innerA + 'background-color:black!important;bottom:20px!important;">&nbsp;&nbsp;' + videoMoved + '</div>';
return true;
};
};
}
};
};
return false;
};

this.onclick = this.oncontextmenu = e => {
if (e.target != this) return;
if(e.button == 0) {
if(cbu.getPrefs("CB.video").substring(0,6) == "videom"){
elem = content.document.getElementsByTagName('object');
if(elem.length == 0) {
elem = content.document.getElementsByTagName('embed')
};

resizeObjs(elem);
resizeObjs(content.document.getElementsByTagName('iframe'));
resizeObjs(content.document.getElementsByTagName('video'));
} else {
if(!handlWin(content))custombuttons.alertSlide1(noFound);
}
};

if(e.button == 1)
gShowPopup(self);


};
this.oncontextmenu = e => e.target != this ? menu.hasAttribute("context")
    : e.ctrlKey || e.shiftKey || e.altKey || e.metaKey || (
        e.detail != 1 ? menu.hidePopup() : !!menu.openPopup(this, "after_start")
    );
custombuttons.alertSlide1 = function(sTitle) {
var as = Components.classes["@mozilla.org/alerts-service;1"].getService(Components.interfaces.nsIAlertsService);
as.showAlertNotification('chrome://global/skin/icons/information-16.png', "", sTitle, false, "", null);
setTimeout(() => as.closeAlert(), 999);
};

function resizeObjs(objs) {
if(!objs) return;
LEVELS = 3;
dir = (cbu.getPrefs("CB.video") == "videomaximize") ? 1 : -1;
for(i = 0; i < objs.length; i++) {
var Width = new Array(LEVELS)
var Height = new Array(LEVELS)
Width[0] = objs[i].clientWidth;
Height[0] = objs[i].clientHeight;
if((Width[0] > (-20 * dir + 100)) && (Height[0] > (-20 * dir + 60))) {
obj = objs[i];
for(var k = 1;
((k < LEVELS) && (obj.parentNode)); k++) {
obj = obj.parentNode
Width[k] = obj.clientWidth;
Height[k] = obj.clientHeight;
};
Width[0] = Width[0] + dir * (Width[0] / 5 | 0);
Height[0] = Height[0] + dir * (Height[0] / 5 | 0);
objs[i].style.width = Width[0] + "px";
objs[i].width = Width[0];
objs[i].style.height = Height[0] + "px";
objs[i].height = Height[0];
obj = objs[i];
for(var k = 1;
((k < LEVELS) && !(objs[i].tagName == 'IFRAME') && (obj.parentNode) && (Width[k]) && (Height[k]) && (Width[k] > (-20 * dir + 100)) && (Height[k] > (-20 * dir + 60))); k++) {
obj = obj.parentNode
Width[k] = Width[k] + dir * (Width[k] / 5 | 0);
Height[k] = Height[k] + dir * (Height[k] / 5 | 0);
obj.style.width = Width[k] + "px";
obj.width = Width[k];
obj.style.height = Height[k] + "px";
obj.height = Height[k];
}
}
};
};

function restProtHost(lnkR, curLoc) {
if(lnkR.length==0)return '';
let tr = lnkR.replace(/^:\/\//, curLoc.protocol + "//");
if(!tr.match(/^https?:\/\//i)){
lnkR = tr.replace(/^\/+/, '');
if(lnkR.split('/')[0].split('?')[0].split('#')[0].toLowerCase().match(/^(?:[-a-z\d]+\.)+[a-z\d]{2,6}$/)){
tr = curLoc.protocol + '//' + lnkR;
}else{
tr = curLoc.protocol + '//' + curLoc.host + "/" + lnkR;
}
};
return tr;
};

function getSrc(vobj, currentLoc) {
var t = '',
tt = '';
if((((t = vobj.innerHTML.match(/<video.*?\ssrc=(?:(?:'([^']*)')|(?:"([^"]*)")|([^\s]*))/i)) && (t) && (tt = t[1] || t[2] || t[3]) && tt.indexOf('blob:') == -1 ) || ((t = vobj.innerHTML.match(/<source.*?\ssrc=(?:(?:'([^']*)')|(?:"([^"]*)")|([^\s]*)).*?\stype=['"]?video\//i)) && (t) && (tt = t[1] || t[2] || t[3]))) && tt.length > 2 && tt.indexOf('blob:') == -1 ) {
if(tt.indexOf(".mp4/?") == -1) {
tt = tt.replace(/&amp;/g, "&")
};
t = restProtHost(tt, currentLoc);
return t;
};
return '';
};

function getLink(obj, curLocation) {


if(!obj || !obj.tagName) return '';
var flashvars = '',
//        src = '',
q = obj.tagName.toLowerCase();

var getParam = function(e, n) {
var v = '',
r = new RegExp('^(' + n + ')$', 'i'),
param = e.getElementsByTagName('param');
for(var igp = 0, p; p = param[igp]; igp++) {
if(p.hasAttribute('name') && p.getAttribute('name').match(r)) {
v = p.getAttribute('value');
break
};
};
return v;
};


if(q == 'object') {
//        src = obj.getAttribute('data') || obj.getAttribute('src') || getParam(obj, 'movie|data|src|code|filename|url') || (obj.getElementsByTagName('embed').length > 0 ? obj.getElementsByTagName('embed')[0].getAttribute('src') : '');
flashvars = getParam(obj, 'flashvars');
} else if(q == 'embed') {
//        src = obj.getAttribute('src');
flashvars = obj.getAttribute('flashvars');
} else return '';


if(!flashvars) return '';
//   src = restProtHost(src, curLocation);

var restPath = function(f, s) {
return(f.substring(0, 4) == 'http') ? f : s.replace(/[#?].*$/, '').replace(/[^\/]*$/, f)
};

function videoLinkExtract(fl) {
//alert(fl);
var linkArr = [],
outLinks = [],
jj = 0,
lba = '',
lbb = '',
decodeURL = function(s) {
try {
return decodeURIComponent(s)
} catch(e) {
return unescape(s)
}
};

for(var ij = 0; ij < 3; ij++) {
lba = lba + String.fromCharCode(parseInt((Math.random() * 15 + 1) + '', 10));
lbb = lbb + String.fromCharCode(parseInt((Math.random() * 15 + 16) + '', 10));
};

function pushWithMerit(lnk) {

var merit = -11;
if(lnk.match(/^https?:\/\//i)) merit = merit + 40;
if(outLinks.length == 0) merit = merit + 1;
if(lnk.match(/^\//)) merit = merit + 7;
if(lnk.match(/^\/\//)) merit = merit + 30;
if(lnk.match(/240p([^a-z]|$)/i)) merit = merit + 1;
if(lnk.match(/[^a-z]240([^a-z0-9]|$)/i)) merit = merit + 1;
if(lnk.match(/360p([^a-z]|$)/i)) merit = merit + 3;
if(lnk.match(/[^a-z]360([^a-z0-9]|$)/i)) merit = merit + 3;
if(lnk.match(/480p([^a-z]|$)/i)) merit = merit + 5;
if(lnk.match(/[^a-z]480([^a-z0-9]|$)/i)) merit = merit + 5;
if(lnk.match(/720p([^a-z]|$)/i)) merit = merit + 7;
if(lnk.match(/[^a-z]720([^a-z0-9]|$)/i)) merit = merit + 7;
if(lnk.match(/\.mp4([^a-z]|$)/i)) merit = merit + 8;
if(lnk.match(/_hd([^a-z]|$)/i)) merit = merit + 6;
if(lnk.match(/\.(jpg|xml)([^a-z]|$)/i)) merit = merit - 40;
if(merit > 0) outLinks.push(merit + lba + lnk);
Services.console.logStringMessage('merit:'+merit+' lnk->'+lnk);
};

linkArr.push(fl);
while(linkArr.length > jj && jj < 30) {

var testPaths = [];
testPaths = linkArr[jj].split(/(\.(?:flv|mp4|m3u8))/i);
if(testPaths[testPaths.length - 1] == '') testPaths.pop();

for(k = 1; k < testPaths.length; k = k + 2) {

if(testPaths[k - 1].indexOf(lba) > -1) {
pref = testPaths[k - 1];
} else {
var testAboutDom = testPaths[k - 1].toLowerCase().split(/(https?:\/\/)/); 
if(testAboutDom[testAboutDom.length - 1]=='') testAboutDom.pop();
var pTest = testAboutDom[testAboutDom.length - 1].split(/(\?[^\?]*?&)/);
if(pTest.length>2){
pTest.pop();
pTest.pop();
};
testAboutDom[testAboutDom.length - 1] = pTest.join('');
pref = testPaths[k - 1].substring(testAboutDom.join('').lastIndexOf("&") + 1);
};

t2 = pref.lastIndexOf(lbb);
if(t2 > -1) {
pref = pref.substring(t2 + 3);
} else {

t2 = pref.lastIndexOf('{"');
if(t2 > -1) pref = pref.substring(t2 + 2);
t2 = pref.lastIndexOf('["');
if(t2 > -1) pref = pref.substring(t2 + 2);
t2 = pref.lastIndexOf(',"');
if(t2 > -1) pref = pref.substring(t2 + 2);
t2 = pref.toLowerCase().lastIndexOf('"http://');
if(t2 > -1) pref = pref.substring(t2 + 1);
t2 = pref.toLowerCase().lastIndexOf('"https://');
if(t2 > -1) pref = pref.substring(t2 + 1);
t2 = pref.toLowerCase().lastIndexOf(',http://');
if(t2 > -1) pref = pref.substring(t2 + 1);
t2 = pref.toLowerCase().lastIndexOf(',https://');
if(t2 > -1) pref = pref.substring(t2 + 1);
t2 = pref.toLowerCase().lastIndexOf(';http');
if(t2 > -1) pref = pref.substring(t2 + 1);
t2 = pref.toLowerCase().lastIndexOf('*https://');
if(t2 > -1) pref = pref.substring(t2 + 1);
t2 = pref.toLowerCase().lastIndexOf(' or ');
if(t2 > -1) pref = pref.substring(t2 + 4);

pref = pref.substring(pref.split('/')[0].toLowerCase().split('%2f')[0].lastIndexOf('=') + 1);

}

if(pref.length > 0) {

if(pref.split('?')[0].toLowerCase().match(/%[2-3][0-9a-f]/)) {

t2 = pref.indexOf('"')
if(t2 > -1) pref = pref.substring(t2 + 1);
suff = testPaths[k + 1] ? testPaths[k + 1].split('&')[0].split('"')[0].split(';')[0].split(/,http/i)[0] : '';
if((suff != testPaths[k + 1]) || (testPaths.length < k + 3)) {
if(testPaths.length > k + 1) {
testPaths[k + 1] = ((pref == testPaths[k - 1]) ? '' : '&') + testPaths[k + 1].substr(suff.length)
};
t2 = pref.lastIndexOf(lba);
if(t2 > -1) pref = pref.substring(t2 + 3)
linkArr.push(decodeURL(pref + testPaths[k] + suff));

} else {
testPaths[k + 1] = (pref == testPaths[k - 1] ? '' : lbb) + pref + testPaths[k] + suff
}
} else {
suff = testPaths[k + 1] ? testPaths[k + 1].split(';')[0].split('"]')[0].split('"}')[0].split('",')[0].split(/,https?:\/\//i)[0].split('*https://')[0].split(' or ')[0] : '';
t2 = suff.indexOf('&');
if((t2 > -1) && (pref != testPaths[k - 1])) {
if(t2 == 0) suff = '';
if(suff.charAt(0) != '?') suff = suff.split(/(&[^&]+=https?:\/\/)/i)[0];
};
if((suff != testPaths[k + 1]) || (testPaths.length < k + 3)) {
if(testPaths.length > k + 1) {
testPaths[k + 1] = ((pref == testPaths[k - 1]) ? '' : '&') + testPaths[k + 1].substr(suff.length)
};
t2 = pref.lastIndexOf(lba);
if(t2 > -1) pref = pref.substring(t2 + 3);
pushWithMerit(pref + testPaths[k] + suff);

} else {
testPaths[k + 1] = lba + (pref == testPaths[k - 1] ? '' : lbb) + pref + testPaths[k] + suff
}
}
}
};
jj = jj + 1;
};

if(outLinks.length == 0) return '';
function srt(a, b) {
a = parseInt(a.substr(0, a.indexOf(lba)), 10);
b = parseInt(b.substr(0, b.indexOf(lba)), 10);
if(a < b) return 1;
if(a > b) return -1;
return 0
};
outLinks.sort(srt);
outLinks[0] = outLinks[0].substr(outLinks[0].indexOf(lba) + 3)
if(outLinks[0].indexOf('_hq.mp4/?time=') > 0) outLinks[0] = outLinks[0].replace(/&/g, '&amp;');
return outLinks[0];
};
ol = videoLinkExtract(flashvars);
if(!ol) return '';
//    ol = ol.replace(/^:?\/\//, curLocation.protocol + "//");
//    return restPath(ol, src);
return restProtHost(ol, curLocation);
};


var menu = self.appendChild(document.createElement("menupopup"));
self.image = "moz-icon://file://" + path;
var playerName = path.split("\\").pop().replace(".exe","");
self.label = "Открыть видео в " +sysPlayerName;
setTimeout(() => {
Menu_n_TooltipTxts.forEach((m) => {
if("separator" in m) {
menu.appendChild(document.createElement("menuseparator"));
return
};
var mItem = document.createElement("menuitem");
mItem.setAttribute("label", m.label);

if("radio" in m) {
mItem.setAttribute("type", "radio");
mItem.setAttribute('checked', cbu.getPrefs("CB.video") == m.value);
if(cbu.getPrefs("CB.video") == m.value) {
self.tooltipText = m.tooltipTxt;
}
mItem.onclick = () => {
cbu.setPrefs("CB.video", m.value);
tmp = (self.image == imgFlashToPlayer || self.image == imgFlashMinimize ||  self.image == imgFlashMaximize);
if(m.value.substring(0,9)=='videotopl'){
self.image = tmp ? imgFlashToPlayer : imgHTML5ToPlayer;
} else if(m.value=='videominimize') {
self.image = tmp ? imgFlashMinimize : imgHTML5Minimize;
} else self.image = tmp ? imgFlashMaximize : imgHTML5Maximize;
self.tooltipText = m.tooltipTxt;
};
}
if("checkbox" in m) {
mItem.setAttribute('type', 'checkbox');
mItem.setAttribute('checked', (self.image == imgFlashToPlayer || self.image == imgFlashMinimize ||  self.image == imgFlashMaximize ));
mItem.onclick = function(e) {
e.stopPropagation();
e.preventDefault();
if(e.button == 0) toggleFlash();
}
}
menu.appendChild(mItem);
});
menu.onclick = function(e) {
e.stopPropagation();
if(e.button > 0) e.preventDefault();
};
}, 100);
var contextMenu = document.getElementById("contentAreaContextMenu"); 
var menuitem = contextMenu.insertBefore(document.createElement("menuitem"), document.getElementById("context-sep-open"));
menuitem.setAttribute("label", "Открыть в " +sysPlayerName);      
menuitem.setAttribute("class", "menuitem-iconic");
menuitem.setAttribute("image", "moz-icon://file://" + path); 
menuitem.onclick = () => play(gContextMenu.linkURL);
addEventListener("popupshowing", ()=> menuitem.hidden = !gContextMenu.onLink, false, contextMenu);
addDestructor(()=> menuitem.remove() );
var contextMenu = document.getElementById("contentAreaContextMenu");
var mItem = contextMenu.insertBefore(document.createElement("menuitem"), document.getElementById("context-copyvideourl"));
mItem.setAttribute("label", openIn);
mItem.onclick = () => {
var vurl = gContextMenu.mediaURL, videoelem = gContextMenu.target;
if(videoelem && videoelem.nodeName.toLowerCase() == 'video') {
if(content.location.hostname.indexOf('youtu') != -1 && (tmp = content.location.toString().match(YoutubeID)) && tmp[1].length == 11) {
play(vurl);
videoMovedbox = content.document.createElement('videoMoved');
videoMovedbox.innerHTML = innerA + innerB + 'top:-15px!important;"><b>' + videoMoved + '</b></div>';
loadURI(stopPl);
content.document.getElementById('eow-title').appendChild(videoMovedbox);
return;
};

if(content.location.hostname == 'www.youtube.com') {
videoelem.parentNode.parentNode.appendChild(videoMovedbox);
} else {
var inFrameHref = inFrameWin.location.href, found = false;
if(inFrameWin.location.hostname == 'www.youtube.com' && (tmp = inFrameHref.match(YoutubeID)) && tmp[1].length == 11){//и значит во фрейме
elem = inFrameWin.parent.document.getElementsByTagName('iframe');
if(elem.length > 0) {
for(i = 0; i < elem.length; i++) {
if(elem[i].contentWindow == inFrameWin) {
elem[i].outerHTML = ytIMGouter(tmp[1]);
found = true;
break;
};
};
};
if(!found)inFrameWin.document.body.innerHTML = ytIMGouter(tmp[1]);
return;
};
videoelem.parentNode.appendChild(videoMovedbox);
};
videoelem.src = '';
try {
videoelem.load()
} catch(e) {};
} else play(vurl);
};


addEventListener("popupshowing", () => {
mItem.hidden = !gContextMenu.onVideo || !gContextMenu.mediaURL;
mItem2.hidden = !gContextMenu.linkURL;
mItem3.hidden = framItem.hidden || gContextMenu.target.ownerDocument.location.hostname.indexOf('youtube.com') == -1;
}, false, contextMenu);
addDestructor(() => {mItem.remove();mItem2.remove();mItem3.remove()});

function play(link) {
var file = Services.dirsvc.get('CurProcD', Ci.nsIFile);
var MozExeDir = file.path.split('\\').slice(0,-1).join('\\');
file.initWithPath(path);
if(!file.exists()) {
custombuttons.alertBox("File not found!", MozExeDir + Path);
return;
};

var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
process.init(FileUtils.File(String.raw`D:\Tube\youtube-dl.exe.lnk`));
process.run(false, [link, cbu.getPrefs("CB.video") == "videotoplaylist" ? addToPlaylistKey : ""], 2);
};
 

Отредактировано anywho (15-06-2019 11:09:57)

Отсутствует

 

№1338616-06-2019 13:39:54

Alex_one
Участник
 
Группа: Members
Зарегистрирован: 27-09-2015
Сообщений: 94
UA: Firefox 67.0

Re: Custom Buttons

Dumby пишет:

Вот, кстати, вариант с символами в несколько колонок.

На [firefox] v.67.0.2 стало всё в одну. Возможно подкорректировать?
Пост

Код

Выделить код

Код:

this.type != "menu" ? this.type = "menu" : (popup => {

    var columns = [
        "¤ ¦ § © « » ¬ ® ° ± µ ¶ — ‘ ’ “ ” • ‰ ‹ › ™",
        "… ≈ ≠ × ✓ ✗ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞",
        "\uD83E\uDD8A \uD83D\uDE0E ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞"
    ];
    var css = //0&&
    `
        #${_id} menuitem > .menu-text {
            font-size: 22px;
            font-family: Consolas, Rockwell, Verdana;
            text-align: center;
            -moz-appearance: none;
            margin: 0;
            padding: 0 14px;
        }
        #${_id} menuitem > :not(.menu-text) {
            display: none;
        }
        #${_id} > menupopup > arrowscrollbox {
            background-color: menu;
        }
    `.replace(/;/g, " !important;");

    var inserter = {
        get docShell() {
            delete this.docShell;
            return this.docShell = "docShell" in document
                && document.docShell instanceof Ci.nsIDocShell
                ? document.docShell : window.docShell;
        },
        get insertText() {
            delete this.insertText;
            return this.insertText = text => {
                if (!this.docShell.isCommandEnabled("cmd_insertText")) return;
                var params = "createCommandParams" in Components.utils
                    ? Cu.createCommandParams()
                    : Components.classes["@mozilla.org/embedcomp/command-params;1"]
                        .createInstance(Components.interfaces.nsICommandParams);
                params.setStringValue("state_data", text);
                this.docShell.doCommandWithParams("cmd_insertText", params);
            }
        },
        insert(text) {
            var br = document.activeElement;
            !br || br.localName != "browser" || !br.isRemoteBrowser
            ? this.insertText(text) : br.messageManager.loadFrameScript(
                `data:,(${this.insertText})${encodeURIComponent(text.toSource())}`
            , false, true);
        }
    };
    this.onmousedown = e => {
        if (e.button) return;
        popup.addEventListener("popupshowing", e => popup.firstChild
            .boxObject.parentBox.setAttribute("orient", "horizontal")
        , {once: true});
        popup.setAttribute("context", "");
        popup.setAttribute("oncommand", "inserter.insert(event.target.label);");
        popup.onauxclick = e => {
            var sym = e.target.label;
            sym && inserter.insert(sym);
        }
        popup.inserter = inserter;
        var df = document.createDocumentFragment();
        for(var symbols of columns) {
            var menugroup = popup.appendChild(document.createElement("menugroup"));
            menugroup.setAttribute("orient", "vertical");
            for(var sym of symbols.split(" ")) menugroup.appendChild(
                document.createElement("menuitem")
            ).setAttribute("label", sym);
        }
        popup.append(df);
        this.onmousedown = null;
        if (!css) return;
        var dwu = "windowUtils" in window && windowUtils instanceof Ci.nsIDOMWindowUtils
            ? windowUtils : window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIDOMWindowUtils);
        var type = dwu.AGENT_SHEET;
        var url = "data:text/css," + encodeURIComponent(css);
        dwu.loadSheetUsingURIString(url, type);
        addDestructor(() => dwu.removeSheetUsingURIString(url, type));
    }
})(this.appendChild(document.createElement("menupopup")));

Отсутствует

 

№1338716-06-2019 16:51:14

Dumby
Участник
 
Группа: Members
Зарегистрирован: 12-08-2012
Сообщений: 931
UA: Firefox 52.0

Re: Custom Buttons

Alex_one пишет:

Возможно подкорректировать?

Вроде получалось

скрытый текст

Выделить код

Код:

if (this.type != "menu") {
    this.type = "menu";
    if (!this.hasAttribute("is")) return;
}
(popup => {
    var columns = [
        "¤ ¦ § © « » ¬ ® ° ± µ ¶ — ‘ ’ “ ” • ‰ ‹ › ™",
        "… ≈ ≠ × ✓ ✗ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞",
        "\uD83E\uDD8A \uD83D\uDE0E ⊞ ⊞ ⊞ ⊞ ⊞ ⊞ ⊞"
    ];
    var css = //0&&
    `
        #${_id} menuitem > .menu-text {
            font-size: 22px;
            font-family: Consolas, Rockwell, Verdana;
            text-align: center;
            -moz-appearance: none;
            margin: 0;
            padding: 0 14px;
        }
        #${_id} menuitem > :not(.menu-text) {
            display: none;
        }
        #${_id} > menupopup > arrowscrollbox {
            background-color: menu;
        }
    `.replace(/;/g, " !important;");

    var inserter = {
        get docShell() {
            delete this.docShell;
            return this.docShell = "docShell" in document
                && document.docShell instanceof Ci.nsIDocShell
                ? document.docShell : window.docShell;
        },
        get insertText() {
            delete this.insertText;
            return this.insertText = text => {
                if (!this.docShell.isCommandEnabled("cmd_insertText")) return;
                var params = "createCommandParams" in Components.utils
                    ? Cu.createCommandParams()
                    : Components.classes["@mozilla.org/embedcomp/command-params;1"]
                        .createInstance(Components.interfaces.nsICommandParams);
                params.setStringValue("state_data", text);
                this.docShell.doCommandWithParams("cmd_insertText", params);
            }
        },
        insert(text) {
            var br = document.activeElement;
            !br || br.localName != "browser" || !br.isRemoteBrowser
            ? this.insertText(text) : br.messageManager.loadFrameScript(
                `data:,(${this.insertText})${encodeURIComponent(text.toSource())}`
            , false, true);
        }
    };
    this.onmousedown = e => {
        if (e.button) return;
        popup.addEventListener("popupshowing", e => {
            var menugroup = popup.firstChild;
            var parent = "boxObject" in menugroup
                ? menugroup.boxObject.parentBox
                : menugroup.flattenedTreeParentNode;
            parent.setAttribute("orient", "horizontal");
            if (parent.localName == "scrollbox")
                parent.style.setProperty("-moz-box-orient", "horizontal", "important");
        }, {once: true});

        popup.setAttribute("context", "");
        popup.setAttribute("oncommand", "inserter.insert(event.target.label);");
        popup.onauxclick = e => {
            var sym = e.target.label;
            sym && inserter.insert(sym);
        }
        popup.inserter = inserter;
        var df = document.createDocumentFragment();
        for(var symbols of columns) {
            var menugroup = popup.appendChild(document.createElementNS(xulns, "menugroup"));
            menugroup.setAttribute("orient", "vertical");
            for(var sym of symbols.split(" ")) menugroup.appendChild(
                document.createElementNS(xulns, "menuitem")
            ).setAttribute("label", sym);
        }
        popup.append(df);
        this.onmousedown = null;
        if (!css) return;
        var dwu = "windowUtils" in window && windowUtils instanceof Ci.nsIDOMWindowUtils
            ? windowUtils : window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIDOMWindowUtils);
        var type = dwu.AGENT_SHEET;
        var url = "data:text/css," + encodeURIComponent(css);
        dwu.loadSheetUsingURIString(url, type);
        addDestructor(() => dwu.removeSheetUsingURIString(url, type));
    }
    this.prepend(popup);
})(document.createElementNS(xulns, "menupopup"));

Отсутствует

 

№1338816-06-2019 18:34:31

Alex_one
Участник
 
Группа: Members
Зарегистрирован: 27-09-2015
Сообщений: 94
UA: Firefox 67.0

Re: Custom Buttons

Dumby
Всё красиво! Спасибо большое!
http://arcanumclub.ru/smiles/thank-you.gif

Отсутствует

 

№1338916-06-2019 21:33:39

oleg953
Участник
 
Группа: Members
Откуда: Ростов где Дон
Зарегистрирован: 07-05-2014
Сообщений: 556
UA: unknown 0.0

Re: Custom Buttons

когда то кнопка была "Night - ночной стиль".. может кто поможет,где её найти?

Отсутствует

 

№1339016-06-2019 23:15:00

kokoss
Участник
 
Группа: Members
Зарегистрирован: 15-02-2018
Сообщений: 395
UA: Firefox 52.0

На форуме

 

№1339117-06-2019 18:30:38

xrun1
Участник
 
Группа: Members
Зарегистрирован: 12-12-2013
Сообщений: 505
UA: Firefox 67.0

Re: Custom Buttons

Давно не работает хорошая кнопка, можно поправить?
Удалить куки текущего сайта

Отсутствует

 

№1339217-06-2019 23:30:26

bunda1
Moderator
 
Группа: Moderators
Откуда: Латвия
Зарегистрирован: 09-02-2010
Сообщений: 4780
UA: Firefox 60.0

Re: Custom Buttons

xrun1 пишет:

Давно не работает хорошая кнопка, можно поправить?
Удалить куки текущего сайта

:/

Выделить код

Код:

custombutton://%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%0D%0A%3Ccustombutton%20xmlns%3Acb%3D%22http%3A//xsms.nm.ru/custombuttons/%22%3E%0A%20%20%3Cname%3E%u0423%u0434%u0430%u043B%u0438%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0442%u0435%u043A%u0443%u0449%u0435%u0433%u043E%20%u0441%u0430%u0439%u0442%u0430%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/png%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAACaklEQVR42rVVu2piURTd6jW+FSMWRkW76WRsRBCbNFY2ATHFlCGdTaZXmU/wB/IHYjGdON2ANlapxELxRQpJjPH9yNy14dzx5prGmRwQb+4+Z2Wttdc+SvQJS/pU0EQi8f3t7S2t0+lOBtvtdr/q9foPBVSSpG+BQOCrXDiNnSRRp9P5Ij/+BXU6nROv10vb7fbDg0KFrEhTOzs7o6enp2eVfIfDQRcXF7Rer1WbAWCz2ZjJZrPhd0ajkVarFS0WC9Lr9fzObDbTaDRSeyozJVk+LZdLFROXy0WtVouq1SrkcQ0A6XSaotEoA0OB1WqldrutBQ0GgzSbzRSGbrebarUaFQoFZpRKpVhRs9mk6XRK4XCYJpMJg9rtdiagke/3++nl5YX/NplMfKBUKvHz/f09JZNJVgIb5vM57wNDoUgDiv/k8/lYGpbH42Ggx8dHur29pUwmw56hIdgDZfv9XrHp/PycialALRYLb0ZRdHM4HPIzGIqDHy2oQUNVoCIuh+EXDUO33+8T9WPDooDCI8REzpoiH3ZgNRoNymazSg1A+BzKR1OFzwooug7P0FUwQMMQGeHt5eUlxWIxbhSmDvVDdcg3zqpA8WIwGKgiBQ9zuRwVi0W6vr6mq6srZiTPN4VCIbq7u1PSgvNIiwoUxX6/z2EWC8wjkQjl83kql8tUqVR4shCdeDxO3W5X2Y9oaUDxotfracYUCQDjm5sbVoEhQJdhASZIWIDkaEBfX1+ZmZjvY5eJwWBgW47dZIigsOLQU8d4PKZ/ufpkYo73kfr58PDgOvWSls/pZPm/VaByFgvyV+F//Jz8AYsmOCaaWhXDAAAAAElFTkSuQmCC%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B//%20%u041D%u0430%u0441%u0442%u0440%u043E%u0439%u043A%u0430%20%u0444%u0443%u043D%u043A%u0446%u0438%u0439%20%u043A%u043B%u0438%u043A%u043E%u0432%20%u043C%u044B%u0448%u0438%20%u0434%u043B%u044F%20%u043A%u043D%u043E%u043F%u043A%u0438%20.............%0Athis.onclick%20%3De%3D%3E%20%7B%0A%20%20%20%0A%20%20%20if%20%28%20e.button%20%3D%3D%200%20%29%20%7B%0A%20%20%20%20%20%20%20%20deleteCookiesFromHost%28%29%3B%0A%20%20%20%20%20%20%20%20//BrowserReload%28%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%0A%20%20%20if%20%28%20e.button%20%3D%3D%201%20%29%20%7B%0A%20%20%20%20%20%20%20%20deleteCookiesFromHost%28%29%3B%0A%20%20%20%20%20%20%20%20reloadAllTabsFromHost%28%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%0A%20%20%20if%20%28%20e.button%20%3D%3D%202%20%26%26%20%21e.ctrlKey%20%29%20%7B%0A%20%20%20%20%20%20%20%20openCookiesPreferneces%28%29%3B%0A%20%20%20%20%20%20%20%20%7D%20%20%20%20%20%20%20%20%0A%7D%3B%0Athis.oncontextmenu%20%3De%3D%3E%20%7B%20%21e.ctrlKey%20%26%26%20e.preventDefault%28%29%20%7D%3B%0A%20%0A%0A//%20%u0423%u0434%u0430%u043B%u0438%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0431%u0430%u0437%u043E%u0432%u043E%u0433%u043E%20%u0434%u043E%u043C%u0435%u043D%u0430%20.............%0Afunction%20deleteCookiesFromHost%28%29%20%7B%0A%20%20%20var%20host%20%3D%20Services.eTLD.getBaseDomain%28gBrowser.currentURI%29%3B%0A%0A%20%20%20//%20%u0443%u0434%u0430%u043B%u0438%u0442%u044C%20%u043E%u0431%u044B%u0447%u043D%u044B%u0435%20%u043A%u0443%u043A%u0438%20%u0434%u043E%u043C%u0435%u043D%u0430%0A%20%20%20for%20%28%20var%20en%20%3D%20Services.cookies.enumerator%3B%20en.hasMoreElements%28%29%3B%20%29%20%7B%0A%20%20%20%20%20%20%20%20%20var%20cookie%20%3D%20en.getNext%28%29.QueryInterface%28Ci.nsICookie%29%3B%0A%20%20%20%20%20%20%20%20%20%7Ecookie.host.indexOf%28host.trim%28%29%29%20%26%26%20Services.cookies.remove%28cookie.host%2C%20cookie.name%2C%20cookie.path%2C%20false%2C%20cookie.originAttributes%20%7C%7C%20undefined%29%3B%20%0A%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%0A%20%20%20//%20%u0443%u0434%u0430%u043B%u0438%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0434%u043E%u043C%u0435%u043D%u0430%20%u0438%u0437%20%u0438%u0441%u0442%u043E%u0440%u0438%u0438%20%20%20%20%20%0A%20%20%20var%20reversedDomain%20%3D%20host.split%28%22%22%29.reverse%28%29.join%28%22%22%29%20+%20%22.%22%3B%0A%20%20%20Cu.import%28%22resource%3A//gre/modules/FileUtils.jsm%22%29%3B%0A%20%20%20var%20file%20%3D%20FileUtils.getFile%28%22ProfD%22%2C%20%5B%22webappsstore.sqlite%22%5D%29%3B%0A%20%20%20var%20dbConn%20%3D%20Services.storage.openDatabase%28file%29%3B%0A%20%20%20dbConn.executeSimpleSQL%28%22DELETE%20FROM%20webappsstore2%20WHERE%20scope%20LIKE%20%5C%22%25%22%20+%20reversedDomain%20+%22%25%5C%22%22%29%3B%0A%20%20%20dbConn.close%28%29%3B%0A%20%20%20%0A%20%20%20//%20%u0443%u0434%u0430%u043B%u0438%u0442%u044C%20%u0432%u0441%u0435%20Flash%20%u043A%u0443%u043A%u0438%0A%20%20%20var%20dir%20%3D%20Services.dirsvc.get%28%27Home%27%2C%20Ci.nsIFile%29%3B%0A%20%20%20dir.append%28%22Application%20Data%22%29%3B%0A%20%20%20dir.append%28%22Macromedia%22%29%3B%0A%20%20%20dir.remove%28true%29%3B%0A%20%20%20dir.create%28Ci.nsIFile.DIRECTORY_TYPE%2C%200777%29%3B%0A%7D%3B%0A%0A%0A//%20%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u043C%u0435%u043D%u0435%u0434%u0436%u0435%u0440%20%u043A%u0443%u043A%u0438%u0441%u043E%u0432%20.............%0Afunction%20openCookiesPreferneces%28%29%20%7B%0A%20%20%20try%20%7B%20Services.wm.getMostRecentWindow%28%22Browser%3ASiteDataSettings%22%29.close%28%29%20%7D%20catch%28e%29%20%7B%7D%3B%0A%20%20%20var%20win%20%3D%20openDialog%28%22chrome%3A//browser/content/preferences/siteDataSettings.xul%22%2C%20%22_blank%22%2C%20%22resizable%2Cdialog%3Dyes%2Ccenterscreen%22%2C%20null%29%3B%0A%20%20%20%0A%20%20%20addEventListener%28%22load%22%2C%20%28%29%3D%3E%20%7B%0A%20%20%20%20%20%20var%20filter%20%3D%20win.document.getElementById%28%22searchBox%22%29%3B%0A%20%20%20%20%20%20filter.value%20%3D%20Services.eTLD.getBaseDomain%28gBrowser.currentURI%29%3B%20%0A%20%20%20%20%20%20setTimeout%28%28%29%3D%3E%20filter.doCommand%28%29%2C%200%29%3B%0A%20%20%20%7D%2C%20false%2C%20win%29%3B%0A%7D%3B%0A%0A%0A//%20%u041F%u0435%u0440%u0435%u0437%u0430%u0433%u0440%u0443%u0437%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%20%u0442%u0435%u043A%u0443%u0449%u0435%u0433%u043E%20%u0441%u0430%u0439%u0442%u0430%20.............%0Afunction%20reloadAllTabsFromHost%28%29%20%7B%0A%20%20%20var%20host%20%3D%20Services.eTLD.getBaseDomain%28gBrowser.currentURI%29%3B%0A%0A%20%20%20for%28%20var%20tab%20of%20gBrowser.tabs%20%29%20%7B%20%20%0A%20%20%20%20%20%20%20%20try%20%7B%20var%20tabHost%20%3D%20Services.eTLD.getBaseDomain%28tab.linkedBrowser.currentURI%29%20%7D%20%0A%20%20%20%20%20%20%20%20catch%28e%29%20%7B%20var%20tabHost%20%3D%20null%20%7D%3B%0A%0A%20%20%20%20%20%20%20%20host%20%3D%3D%20tabHost%20%26%26%20gBrowser.reloadTab%28tab%29%3B%0A%20%20%20%20%20%20%20%20%7D%0A%7D%3B%0A%0A%0Athis.tooltipText%20%3D%20%22%u041B%3A%20%u0423%u0434%u0430%u043B%u0438%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0442%u0435%u043A%u0443%u0449%u0435%u0433%u043E%20%u0441%u0430%u0439%u0442%u0430%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Cn%u0421%3A%20%u0423%u0434%u0430%u043B%u0438%u0442%u044C%20%u043A%u0443%u043A%u0438%20%u0442%u0435%u043A%u0443%u0449%u0435%u0433%u043E%20%u0441%u0430%u0439%u0442%u0430%20+%20%u043E%u0431%u043D%u043E%u0432%u0438%u0442%u044C%20%u0432%u0441%u0435%20%u0432%u043A%u043B%u0430%u0434%u043A%u0438%20%u0442%u0435%u043A%u0443%u0449%u0435%u0433%u043E%20%u0441%u0430%u0439%u0442%u0430%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5Cn%u041F%3A%20%u0423%u043F%u0440%u0430%u0432%u043B%u0435%u043D%u0438%u0435%20%u043A%u0443%u043A%u0430%u043C%u0438%20%u0434%u043B%u044F%20%u0442%u0435%u043A%u0443%u0449%u0435%u0433%u043E%20%u0441%u0430%u0439%u0442%u0430%5C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%5CnCtrl+%u041F%3A%20CB%20%u041C%u0435%u043D%u044E%22%3B%5D%5D%3E%3C/initcode%3E%0A%20%20%3Ccode%3E%3C%21%5BCDATA%5B/*CODE*/%5D%5D%3E%3C/code%3E%0A%20%20%3Caccelkey%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/accelkey%3E%0A%20%20%3Chelp%3E%3C%21%5BCDATA%5B%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E

Отсутствует

 

№1339319-06-2019 00:05:01

xrun1
Участник
 
Группа: Members
Зарегистрирован: 12-12-2013
Сообщений: 505
UA: Firefox 67.0

Re: Custom Buttons

bunda1
ЛКМ и СКМ работают, а вот ПКМ - Управление куками текущего сайта, нет. В принципе, не особо это важно. Спасибо!

Отсутствует

 

№1339419-06-2019 13:05:57

anywho
Забанен
 
Группа: Members
Зарегистрирован: 21-05-2019
Сообщений: 54
UA: Firefox 67.0

Re: Custom Buttons

Dumby

Что они там пугают своим косяком "уязвимость.. и т.д" , Есть какие мысли?

Отредактировано anywho (19-06-2019 13:34:54)

Отсутствует

 

№1339520-06-2019 10:16:27

vitalii201
Участник
 
Группа: Members
Зарегистрирован: 24-03-2011
Сообщений: 578
UA: Firefox 67.0

Re: Custom Buttons

Подскажите, пожалуйста, код для кнопки "Закрыть вкладки справа".

Отсутствует

 

№1339620-06-2019 11:22:59

bunda1
Moderator
 
Группа: Moderators
Откуда: Латвия
Зарегистрирован: 09-02-2010
Сообщений: 4780
UA: Firefox 60.0

Re: Custom Buttons

vitalii201 пишет:

Подскажите, пожалуйста, код для кнопки "Закрыть вкладки справа".

Выделить код

Код:

gBrowser.removeTabsToTheEndFrom(gBrowser.selectedTab);

Отсутствует

 

№1339720-06-2019 12:08:54

vitalii201
Участник
 
Группа: Members
Зарегистрирован: 24-03-2011
Сообщений: 578
UA: Firefox 67.0

Re: Custom Buttons

bunda1, большое спасибо!

Отсутствует

 

№1339820-06-2019 16:52:44

anywho
Забанен
 
Группа: Members
Зарегистрирован: 21-05-2019
Сообщений: 54
UA: Firefox 67.0

Re: Custom Buttons

bunda1
Если не ошибаюсь, это ваша кн.? В 67 не определяет ID места , только вручную ...А, жаль..

скрытый текст

Выделить код

Код:

/*Initialization Code*/
((popup, {lastChild} = popup, pref = "CB.bookmark") =>
addDestructor(reason => reason == "delete" && Services.prefs.clearUserPref(pref)) +
addEventListener("popupshowing", {
    index: 0, // 0 - первой, PlacesUtils.bookmarks.DEFAULT_INDEX - последней
    width: 500,
    height: 640,
    nodePosition: .35,
    handleEvent(e) {
        if (e.target != popup || this.souldHide()) return;
        var menuitem = document.createElement("menuitem");
        menuitem.id = "context-addBookmark";
        menuitem.className = "menuitem-iconic";
        menuitem.setAttribute("image", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAB0UlEQVR42p2SS0gbURiFz73TcSUUXYi4EGLATRDSLnzgpqC4rLgXcVFo6TJY0AayURCtLtqK2G5sEd2LguIDF4W0mzaIbTVCxQcJihPzUJJ53/4ZJThNrOI/c5j7z9zz3TNzh9X7Wp/29L6YR4mafD/cET/8vYr/FBt6MyOCfd1FDzRDYOztbEnT+Eh/Q1KJ/XQBjmIKJM7BJU5XBkmSUFlRXhLQPzhzMBJ61gToJwVAQklAzpsLYhCQ0BSI3xh/d+F5pwvQHkoVTfoYqAWTZJxdCKfnjCGdUW0lJVJTi/HKAuDRyz/4/NqDrCZgWoBFornYPOTYjgloJvWCo+wBsBM9NTa+qd/9Pr3ZBfgU9GD1l42sCuQ05ig/zq/NBHMkcyC6c2qshXMRv99odAE+vPJgectGjkyqzmknAIOSgIwcFIdSyNRGtxVj7Us24m/5BzARqMPCDwuqxqGS2bwyOweZQfdkirO7dwNgfdSL47SgyOwytxMdl+O8bDotG+l0TuzHRWZs6eShCxCZ9OL2MiAsE8kLCW0DR3ABvr7zIpmhv5A+uW6QdJN2g95DCCeBZYur3kbivAwDcwmwquq6lpqulfAdli6qzeknj9l9jNfrL3fWCMvzB8ayAAAAAElFTkSuQmCC");
        menuitem.setAttribute("oncommand", "linkedObject.oncommand(event);");
        menuitem.linkedObject = this;
        menuitem.onauxclick = e => {
            if (e.button == 1) return;
            e.preventDefault();
            popup.hidePopup();
            this.pick();
        }
        popup.insertBefore(menuitem, lastChild.nextSibling);
        addDestructor(() => menuitem.remove());
        (this.handleEvent = e => e.target == popup
            && !(menuitem.hidden = this.souldHide())
            && this.update(menuitem)
        )(e);
    },
    ons: ["isContentSelected", "onTextInput", "onImage", "onVideo", "onCanvas", "onAudio"],
    souldHide() {
        if (gContextMenu.onLink) return false;
        return this.ons.some(on => gContextMenu[on]);
    },
    oncommand(e) {
        this[e.ctrlKey || e.shiftKey ? "pick" : "bookmark"](e.target);
    },
    get guid() {
        return Services.prefs.getStringPref(pref, PlacesUtils.bookmarks.toolbarGuid);
    },
    async update(menuitem) {
        var info = await PlacesUtils.bookmarks.fetch(this.guid);
        var title = PlacesUtils.bookmarks.getLocalizedTitle(info);
        menuitem.label = "Добавить закладку в: " + (
            menuitem.folderName = title || "[без заголовка]"
        );
    },
    pick() {
        var features = "chrome,all,resizable,centerscreen,modal";
        window.openDialog(this.url, "_blank", features, this.guid);
    },
    bookmark({folderName}) {
        if (gContextMenu.onLink) {
            var url = gContextMenu.linkURL;
            var title = gContextMenu.linkText();
        } else {
            var url = gBrowser.currentURI.spec;
            var title = gBrowser.contentTitle || gBrowser.selectedTab.label;
        }
        var info = {url, title, parentGuid: this.guid, index: this.index};
        PlacesUtils.bookmarks.insert(info).then(
            () => this.notify(title, "Добавил закладку в папку: " + folderName),
            err => this.notify("Ошибка", err)
        );
    },
    get as() {
        delete this.as;
        return this.as = Cc["@mozilla.org/alerts-service;1"]
            .getService(Ci.nsIAlertsService);
    },
    notify(title, msg) {
        this.as.showAlertNotification("chrome://global/skin/icons/cpd_OK.png", title, msg);
        setTimeout(this.as.closeAlert, 1800);
    },
    get url() {
        var xul = `
            <?xml version="1.0"?>
            <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
            <?xml-stylesheet href="chrome://browser/content/places/places.css"?>
            <?xml-stylesheet href="chrome://browser/skin/places/places.css"?>
            <dialog xmlns="${xulns}"
                id="bookmark-folder-saver-dialog"
                windowtype="bookmark-folder-saver:dialog"
                title="Выберите папку"
                buttons="accept,cancel"
                onload="init();"
                ondialogaccept="dialogCallback();"
                width="${this.width}"
                height="${this.height}">

                <script type="application/javascript" src="chrome://global/content/globalOverlay.js"/>
                <script type="application/javascript" src="chrome://browser/content/utilityOverlay.js"/>
                <script type="application/javascript"><![CDATA[
                    ChromeUtils.defineModuleGetter(window, "PlacesUtils", "resource://gre/modules/PlacesUtils.jsm");
                    ChromeUtils.defineModuleGetter(window, "PlacesUIUtils", "resource:///modules/PlacesUIUtils.jsm");
                    ChromeUtils.defineModuleGetter(window, "PlacesTransactions", "resource://gre/modules/PlacesTransactions.jsm");
                    ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
                    XPCOMUtils.defineLazyScriptGetter(window, "PlacesTreeView", "chrome://browser/content/places/treeView.js");
                    XPCOMUtils.defineLazyScriptGetter(
                        window,
                        ["PlacesInsertionPoint", "PlacesController", "PlacesControllerDragHelper"],\n\
                        "chrome://browser/content/places/controller.js"\n\
                    );
                ]]></script>
                <keyset>
                    <key id="key-accept" keycode="VK_RETURN" modifiers="control"
                        oncommand="document.documentElement.acceptDialog();" />
                </keyset>
                <tree id="tree" type="places"
                    place="place:type=${
                        Ci.nsINavHistoryQueryOptions.RESULTS_AS_ROOTS_QUERY
                    }&amp;excludeItems=1&amp;excludeQueries=1"
                    hidecolumnpicker="true" seltype="single" flex="1">
                    <treecols>
                        <treecol id="title" flex="1" primary="true" hideheader="true" />
                    </treecols>
                    <treechildren />
                </tree>
                <script type="application/javascript"><![CDATA[
                    var tree = document.getElementById("tree");
                    function init() {
                        tree.selectItems([window.arguments[0]]);
                        var ind = tree.view.selection.currentIndex;
                        ind != -1 && setTimeout(() => {
                            var tbo = tree.treeBoxObject;
                            var first = tbo.getFirstVisibleRow();
                            var visibleRows = tbo.height/tbo.rowHeight;
                            var newFirst = ind - ${this.nodePosition}*visibleRows + 1;
                            tbo.scrollByLines(Math.round(newFirst - first));
                            tbo.ensureRowIsVisible(ind);
                        }, 0);
                    }
                    function dialogCallback() {
                        var ind = tree.view.selection.currentIndex;
                        if (ind == -1) return;
                        var item = tree.view.nodeForTreeIndex(ind);
                        item && Services.prefs.setStringPref(
                            "${pref}", PlacesUtils.getConcreteItemGuid(item)
                        );
                    }
                ]]></script>
            </dialog>`;
        var url = URL.createObjectURL(new Blob(
            [xul.trimLeft()], {type: "application/vnd.mozilla.xul+xml"}
        ));
        addDestructor(() => URL.revokeObjectURL(url));
        delete this.url; return this.url = url;
    }
}, false, popup || 1))(document.getElementById("contentAreaContextMenu"));

Отсутствует

 

№1339920-06-2019 17:44:16

bunda1
Moderator
 
Группа: Moderators
Откуда: Латвия
Зарегистрирован: 09-02-2010
Сообщений: 4780
UA: Firefox 60.0

Re: Custom Buttons

Не моя, это наверно Dumby. По стилю видно.

Отсутствует

 

№1340020-06-2019 18:11:32

Stkvsky
Участник
 
Группа: Members
Зарегистрирован: 26-06-2012
Сообщений: 1104
UA: Firefox 42.0

Re: Custom Buttons

Помогите пожалуйста починить кнопку:
Кнопка открывает сайты в боковой панели
ПКМ - открыть сайт в боковой панели
ЛКМ - открыть список сайтов
СКМ - добавить сайт в список


Так вот в мультипроцессном режиме ПКМ не отрывает сайт, хотя если открывать сайт ЛКМ из списка то он открывается.

скрытый текст

Выделить код

Код:

var menuPopup = self.appendChild(document.createElement("menupopup")),
    help = self.Help;

menuPopup.setAttribute('context', '');

for (var item of help.split('\n\n')) {
  var mItem = document.createElement("menuitem"),
      params = item.split('\n'),
      title = params[0],
      url = params[1],
      icon = !params[2] ? '' : params[2];

  mItem.setAttribute('label', title);
  mItem.setAttribute('tooltiptext', url);
  mItem.setAttribute('class', 'menuitem-iconic');
  mItem.setAttribute('image', icon || "chrome://mozapps/skin/places/defaultFavicon.png");
  mItem.setAttribute('oncommand', 'openWebPanel("' + title + '", "' + url + '")');
  mItem.setAttribute('oncontextmenu', 'this.parentNode.parentNode.removePage("' + encodeURIComponent(title) + '", "' + encodeURIComponent(url) + '", "' + encodeURIComponent(icon) + '");');

  menuPopup.appendChild(mItem);
}

[
  {sep: ''},
  {lbl: 'Редактировать кнопку', cmd: 'custombuttons.editButton(this.parentNode.parentNode);'},
  {lbl: 'Открыть адрес из буфера обмена', cmd: 'openWebPanel(gClipboard.read(), gClipboard.read());'},
  {lbl: 'Добавить текущий сайт', cmd: 'this.parentNode.parentNode.addPage();'}
].forEach(m=> {
  if ('sep' in m)
    menuPopup.appendChild(document.createElement("menuseparator"));
  else {
    var extraItems = menuPopup.appendChild(document.createElement("menuitem"));

    extraItems.setAttribute('label', m.lbl);
    extraItems.setAttribute('oncommand', m.cmd);
  }
});

this.addPage =()=> {
  var iconLink = gBrowser.mCurrentTab.image,
      icon = !iconLink ? '' : (!iconLink.startsWith('chrome:') ? '\nmoz-anno:favicon:' + iconLink : '\n' + iconLink),
      newItem = [,,window.content.document.title, window.content.document.location + icon].join('\n'),
      link = custombuttons.makeButtonLink("edit", _id),
      param = custombuttons.cbService.getButtonParameters(link);

  param = param.wrappedJSObject || param;
  param.help = param.help + newItem;

  custombuttons.cbService.installButton(param);
};

this.removePage =(aTitle, aURL, aIcon)=> {
  var itemsToRemove = [],
      link = custombuttons.makeButtonLink("edit", _id),
      param = custombuttons.cbService.getButtonParameters(link);

  aIcon = !aIcon ? '' : '\n' + aIcon;

  param = param.wrappedJSObject || param;
  itemsToRemove.push([,,aTitle, aURL + aIcon].join('\n'), [aTitle, aURL + aIcon,,,].join('\n'));

  for (var item of itemsToRemove)
    param.help = param.help.replace(decodeURIComponent(item), '');

  custombuttons.cbService.installButton(param);
};

this.onclick =e=> {
  if (e.target !== this) return;

  if (e.button == 0)
    menuPopup.openPopup(this, 'after_start')

  if (e.button == 1)
    this.addPage();

  if (e.button == 2 && !e.shiftKey && !e.ctrlKey && !e.altKey)
    e.preventDefault(), e.stopPropagation(),
      openWebPanel(window.content.document.title, window.content.document.location);;
};

this.tooltipText = 'ЛКМ: Открыть меню со списком заданных адресов\nСКМ: Добавить текущий сайт в спискок заданных адресов\nПКМ: Открыть адрес активной вкладки';

(contextMenu => {
  var menuitem = document.createElement("menuitem");

  menuitem.id = "open-in-sidebar";
  menuitem.setAttribute("label", "Open in Sidebar");
  menuitem.setAttribute("oncommand", "openWebPanel(gContextMenu.getLinkURL(), gContextMenu.getLinkURL())");
  contextMenu.insertBefore(menuitem, document.getElementById("context-sep-open"));

  addEventListener("popupshowing", ()=> menuitem.hidden = !gContextMenu.onLink, false, contextMenu);
  addDestructor(()=> contextMenu.removeChild(menuitem));
})(document.getElementById("contentAreaContextMenu"));

((browser, listener, br) => { if (browser) {
  addEventListener("DOMFrameContentLoaded", listener, true, browser);
  var getBr = () => browser.contentDocument.querySelector(listener.selector);
  if ((br = getBr())) br.window = {parent: listener.parent};
  addDestructor(() => {
    if ((br = getBr())) delete br.window;
  });
}})(SidebarUI.browser, {
  selector: "browser#web-panels-browser",
  handleEvent(e) {
    if (e.target.matches(this.selector)) {
      var wp = e.target;
      if (!wp.hasAttribute("disableglobalhistory"))
        wp.setAttribute("disableglobalhistory", "false");
      if (wp.hasAttribute("contextfixed")) return;
      [
        ["#context-back", "wp.goBack();"],
        ["#context-forward", "wp.goForward();"],
        ["#context-reload", "wp.reload();"],
        ["#context-stop", "wp.stop();"]
      ].forEach(m=> {
        var mItem = SidebarUI.browser.contentDocument.querySelector(m[0]);
        mItem.onclick =()=> eval(m[1]);
        SidebarUI.browser.contentDocument.querySelector("#context-reload")
          .style.setProperty('display', '-moz-box', 'important');
      });
      wp.setAttribute('contextfixed', 'true');
    }
    if (e.target.matches(this.selector) && !("window" in e.target))
      e.target.window = {parent: this.parent};
  },
  get parent() {
    delete this.parent;
    var parent = {};
    parent.contentAreaClick = eval(`(${
      contentAreaClick.toString().replace(
        'linkNode.getAttribute("onclick")',
         "!target && this.shouldLoadInPanelBrowser(linkNode) || $&"
      )
    })`);
    parent.shouldLoadInPanelBrowser = link => {
      if (!(link.ownerDocument.location.protocol == "file:"
            && link.className == 'file')) return true;
    }
    return this.parent = parent;
  }
});

Отредактировано Stkvsky (20-06-2019 18:16:49)

Отсутствует

 

Board footer

Powered by PunBB
Modified by Mozilla Russia
Copyright © 2004–2011 Mozilla Russia
Язык отображения форума: [Русский] [English]