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

Заказывай стафф с атрибутикой Mozilla и... пусть все вокруг завидуют тебе! Быть уникальным - быть с Mozilla!

№1587605-09-2021 11:58:31

ВВП
Участник
 
Группа: Members
Зарегистрирован: 13-03-2021
Сообщений: 150
UA: Firefox 91.0

Re: Custom Buttons

kaktusok
Вот кнопка на все времена. И все плееры (Mpc,KMP и т.д) Путь к плееру -см. внимательно , свой !Перехват всего MP4  и прямых . Кроме, HLS/TS , ссылку дучше из IDM иди аддона Video DownloadHelper и из буфера обмена в плеер(ПКМ)

Выделить код

Код:

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%20%u0432%20Potplayer%3C/name%3E%0A%20%20%3Cimage%3E%3C%21%5BCDATA%5Bdata%3Aimage/x-icon%3Bbase64%2CAAABAAEAEhIAAAEAIACABQAAFgAAACgAAAASAAAAJAAAAAEAIAAAAAAAWAUAAAAAAAAAAAAAAAAAAAAAAACFEg4A/1QOAf9bFy/qSQ1i7UQEYuxHBmHtSAhi7EcLY+1IDGLtSAxj7EgLYu1ICmPsSAhi7kQEYelDCmL5aBU4/8kkAls/EQBxCwAA70YHcaYjAPx1DwD/fBIA/3wTAP99EwD/fhMA/30SAP9+EwD/fhMA/30TAP99EwD/fRMA/3UPAP+aHgD/5UYGjxkIAAD/jAYYxS4A6lEAAP1YAAD1WgEA+VkCAPlZAAD5WQEA+lkCAPpZAAD6WAIA+lkAAPpZAAD4WQMA+V0BAPdJAAD4riIA//9pDizwVBhKmR0A/1gAAPlpBgD8ZQkA/GQFAP1lBwD+ZgkA/mcGAP5mCAD+ZgcA/mUFAP5jCQD8ZQYA/WkGAPxYAQD3iRcA/elQEmzrSw9XgBMA/lgAAPpgBQD9XAYA/WICAP1iCQD+YQYA/mEDAP5fCgD+YgQA/mMFAP5hCwD+XgAA/WEHAP5XAgD5eA8A/u9LDXbyVBZSkBgA/lMAAPpkBQD9bgoA/m0MAP5kBQD+YwUA/2IIAP9iBQD/YQUA/2MGAP9xCwD+cAsA/mYGAP5XAAD5hhQA//JVGHP6WxZUpyQA/2MEAPqGFwD9fBMA/mAGAP5hBgD+YAYA/mUJAP5jBgD+YQUA/mAGAP5iBQD+gRMA/ooXAP5sCQD6nyIA//ZbGHX+WhFVxTMA/5UbAPqbIAD+YgYA/14DAP1hBgD/YgUA/1QAAP9dBAD/ZAgA/2QIAP9dAwD/ZQgA/aMiAP+eIAD5vjIA//pgFXb/Ww5U7EIA/70vAPqHFQD9WgIA/loCAP59EQD+6kwL/70xAf9lBAD/UwAA/18HAP9lCAD+VAAA/o4ZAP7LNQD65kIA//1mGXX+Xw1V/1cQ/9UyAPpoCQD+YgUA/1QAAP6QGAD/+20d//94Jf/5Xw7/oikD/2EAAP9dAgD/WwIA/nENAP/lOwH6/1kR//tzLHb6ZQ1U/mog/90/CfpeBAD+ZQgA/1MAAf6ZHgD/+oc5//6USv/+k03//5JG//NsIP+RIwj/WAEA/mgIAP/fSBT6/nEt//p/OnX7bxxV/3kr/91PFvpfBAD+ZQkA/1IBAf6qIwD//55W//+jZf/9o2P//LBn//ukUP+sPRv/TQAA/moNAf/iVxn6/3or//uBOnb8dipU/os//+9oHvp/DAD9YgYA/2AAAf65MAD//q9R//7Iaf/9xWH/+oQu/8gqAP96CAD+WQIA/owNAP7zbST6/o1B//yDOXX+fS5S/JpW//+WR/q5NhH+ZwgC/o0UA/7fRwD+/+Vd//3QVP//dhr/+EAB/91GFf/sVRb/xzML/eNfHf//p1X6/bte//6KPHP/gTRX/Z5e/fyrZ/rvkDz9sB8A/6wgAv3rSQD//YEk/v5hG/7+Sw/+/2Ug/v92Kf7/ZB/+/3kq/v/eXv7+61r5/+Jj/f+VO3j+lERC/6he//2nYfj/yWH9+ak0/eNAAP70NgL9/k0U/v5gHf7+dyn+/nwy/v14Jv78iTb+/NiR/vz/lv7+/Ib7//GU//6HMmH/o08L/ptBuv+3Zf/90178//ln///cef/+mVX//341//6ANf//kEr//6Ra///Kkf/+8uT//v/d//75nv/7/6///cZr0/5dCBb/hCgA/2USE/6tSIT/3Wap/ux+pP/6oqb+86Wm/vCpp/7ytaf+9bun//Wwp//4rab/+Lym/uyzpf/mnqj+uFaQ/okNH/+OHACAAEAAgABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAQAA%3D%5D%5D%3E%3C/image%3E%0A%20%20%3Cmode%3E0%3C/mode%3E%0A%20%20%3Cinitcode%3E%3C%21%5BCDATA%5B%28func%20%3D%3E%20%7B%0A%09var%20sysPlayerName%20%3D%20%22Pot%20Player%22%3B%0A%09var%20path%20%3D%20%22D%3A%5C%5CPotPlayer%5C%5CPotPlayerMini64.exe%22%3B%0A%09var%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%20+%20sysPlayerName%3B%0A%09var%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%20+%20sysPlayerName%3B%0A%0A%09%0A%09this.label%20%3D%20%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0432%u0438%u0434%u0435%u043E%20%u0432%20%22%20+%20sysPlayerName%3B%0A%09this.tooltipText%20%3D%20%22%u041B%3A%20%u0412%u0438%u0434%u0435%u043E%20%u0432%20%u043F%u043B%u0435%u0435%u0440%5Cn%u041F%3A%20%u0412%u0438%u0434%u0435%u043E%20%u0438%u0437%20Clipboard%22%3B%0A%0A%09this._handleClick%20%3D%20%28%29%20%3D%3E%20%7B%0A%09%09var%20msgName%20%3D%20_id%20+%20%22%3APlayer%22%3B%0A%09%09var%20listener%20%3D%20%28%7Bdata%7D%29%20%3D%3E%20data%20%3F%20run%28%5Bdata%5D%29%20%3A%20notify%28%29%3B%0A%09%09messageManager.addMessageListener%28msgName%2C%20listener%29%3B%0A%09%09addDestructor%28%28%29%20%3D%3E%20messageManager.removeMessageListener%28msgName%2C%20listener%29%29%3B%0A%0A%09%09var%20url%20%3D%20%22data%3Acharset%3Dutf-8%2C%22%20+%20encodeURIComponent%28%0A%09%09%09%60%28%24%7Bfunc%7D%29%28%29%60.replace%28%22MSG_NAME%22%2C%20msgName%29%0A%09%09%09%09.replace%28%22VIDEO_MOVED%22%2C%20encodeURIComponent%28videoMoved%29%29%0A%09%09%09%09.replace%28%22CONFIRM%22%2C%20encodeURIComponent%28%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0441%u0441%u044B%u043B%u043A%u0443%20%u0432%20%u043F%u043B%u0435%u0435%u0440%u0435%20%3F%22%29%29%0A%09%09%29%3B%0A%09%09%28this._handleClick%20%3D%20%28%29%20%3D%3E%20gBrowser.selectedBrowser.messageManager.loadFrameScript%28url%2C%20false%29%29%28%29%3B%0A%09%7D%0A%09this.onauxclick%20%3D%20e%20%3D%3E%20e.button%20%21%3D%201%20%7C%7C%20gShowPopup%28this%29%3B%0A%09this.oncontextmenu%20%3D%20e%20%3D%3E%20%7B%0A%09%09if%20%28e.ctrlKey%20%7C%7C%20e.shiftKey%20%7C%7C%20e.altKey%29%20return%3B%0A%09%09e.preventDefault%28%29%3B%0A%09%09custombuttons.confirmBox%28null%2C%20%22%u0417%u0430%u043F%u0443%u0441%u0442%u0438%u0442%u044C%20%u043F%u043B%u0435%u0435%u0440%20%u0438%u0437%20%u0431%u0443%u0444%u0435%u0440%u0430%20%u043E%u0431%u043C%u0435%u043D%u0430%20%3F%22%2C%20%22%u0414%u0430%22%2C%20%22%u041D%u0435%u0442%22%29%0A%09%09%09%26%26%20run%28%5BgClipboard.read%28%29%2C%20%22/play%22%5D%29%3B%0A%09%7D%0A%09var%20popup%20%3D%20document.getElementById%28%22contentAreaContextMenu%22%29%3B%0A%09addEventListener%28%22popupshowing%22%2C%20%7B%0A%09%09get%20hidden%28%29%20%7B%0A%09%09%09return%20%21%28gContextMenu.onLink%20%7C%7C%20gContextMenu.onVideo%20%7C%7C%20gContextMenu.onPlainTextLink%29%3B%0A%09%09%7D%2C%0A%09%09handleEvent%28%29%20%7B%0A%09%09%09if%20%28this.hidden%29%20return%3B%0A%09%09%09var%20menuitem%20%3D%20document.createXULElement%28%22menuitem%22%29%3B%0A%09%09%09for%28var%20args%20of%20Object.entries%28%7B%0A%09%09%09%09image%3A%20self.image%2C%0A%09%09%09%09oncommand%3A%20%22play%28%29%22%2C%0A%09%09%09%09class%3A%20%22menuitem-iconic%22%2C%0A%09%09%09%09label%3A%20%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0432%20%22%20+%20sysPlayerName%0A%09%09%09%7D%29%29%0A%09%09%09%09menuitem.setAttribute%28...args%29%3B%0A%09%09%09menuitem.play%20%3D%20%28%29%20%3D%3E%20play%28gContextMenu.linkURL%20%7C%7C%20gContextMenu.mediaURL%29%3B%0A%09%09%09document.getElementById%28%22context-savelink%22%29.before%28menuitem%29%3B%0A%09%09%09addDestructor%28%28%29%20%3D%3E%20menuitem.remove%28%29%29%3B%0A%09%09%09this.handleEvent%20%3D%20e%20%3D%3E%20%7B%0A%09%09%09%09if%20%28e.target%20%3D%3D%20popup%29%20menuitem.hidden%20%3D%20this.hidden%3B%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%2C%20false%2C%20popup%20%7C%7C%201%29%3B%0A%0A%09var%20play%20%3D%20link%20%3D%3E%20custombuttons.confirmBox%28null%2C%20%22%u041E%u0442%u043A%u0440%u044B%u0442%u044C%20%u0441%u0441%u044B%u043B%u043A%u0443%20%u0432%20%u043F%u043B%u0435%u0435%u0440%u0435%20%3F%22%2C%20%22%u0414%u0430%22%2C%20%22%u041E%u0442%u043C%u0435%u043D%u0430%22%29%20%26%26%20run%28%5Blink%5D%29%3B%0A%09var%20run%20%3D%20args%20%3D%3E%20%7B%0A%09%09var%20file%20%3D%20FileUtils.File%28path%29%3B%0A%09%09%28run%20%3D%20args%20%3D%3E%20%7B%0A%09%09%09if%20%28%21file.exists%28%29%29%20return%20custombuttons.alertBox%28%22File%20not%20exists%21%22%2C%20path%29%3B%0A%09%09%09var%20process%20%3D%20Cc%5B%22@mozilla.org/process/util%3B1%22%5D.createInstance%28Ci.nsIProcess%29%3B%0A%09%09%09process.init%28file%29%3B%0A%09%09%09process.runwAsync%28args%2C%20args.length%29%3B%0A%09%09%7D%29%28args%29%3B%0A%09%7D%0A%09var%20notify%20%3D%20%28%29%20%3D%3E%20%7B%0A%09%09var%20name%20%3D%20_id%20+%20%22-noFound%22%3B%0A%09%09var%20as%20%3D%20Cc%5B%22@mozilla.org/alerts-service%3B1%22%5D.getService%28Ci.nsIAlertsService%29%3B%0A%09%09%28notify%20%3D%20%28%29%20%3D%3E%20setTimeout%28as.closeAlert%2C%201150%2C%20name%2C%20as.showAlertNotification%28%0A%09%09%09%22chrome%3A//global/skin/icons/question-48.png%22%2C%20%22%22%2C%20noFound%2C%20false%2C%20%22%22%2C%20null%2C%20name%0A%09%09%29%29%29%28%29%3B%0A%09%7D%0A%0A%7D%29%28%28%29%20%3D%3E%20%7B%0A%0A%09var%20found%2C%20videoMoved%2C%20SEND%20%3D%20msg%20%3D%3E%20%7B%0A%09%09found%20%3D%20true%3B%0A%09%09if%20%28%21msg%20%7C%7C%20Cc%5B%22@mozilla.org/embedcomp/prompt-service%3B1%22%5D%0A%09%09%09.getService%28Ci.nsIPromptService%29%0A%09%09%09.confirm%28content%2C%20null%2C%20decodeURIComponent%28%22CONFIRM%22%29%29%0A%09%09%29%20%7B%0A%09%09%09if%20%28msg%29%20videoMoved%20%3D%20decodeURIComponent%28%22VIDEO_MOVED%22%29%3B%0A%09%09%09sendAsyncMessage%28%22MSG_NAME%22%2C%20msg%29%3B%0A%09%09%7D%0A%09%09else%20return%20true%3B%0A%09%7D%0A%0A%09var%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%09var%20tmp%20%3D%20%27%27%2C%0A%09tmpp%20%3D%20%27%27%2C%0A%09innerA%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%0A%09innerB%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%0A%09//stopPl%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%0A%09ytIMGouter%20%3D%20function%20%28ytID%29%20%7B%0A%09%09return%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%0A%09%7D%2C%0A%09handlWin%20%3D%20function%20%28currentWin%29%20%7B%0A%09%09tmp%20%3D%20%27%27%3B%0A%09%09var%20elem%20%3D%20currentWin.document.getElementsByTagName%28%27video%27%29%2C%0A%09%09currLoc%20%3D%20currentWin.location%3B%0A%09%09if%20%28elem.length%20%3E%200%29%20%7B%0A%09%09%09if%20%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%0A%0A%09%09%09%09if%20%28SEND%28%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%29%20return%3B%0A%0A%09%09%09%09videoMovedbox%20%3D%20currentWin.document.createElement%28%27videoMoved%27%29%3B%0A%09%09%09%09videoMovedbox.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%0A%0A%09%09%09%09//loadURI%28stopPl%29%3B%0A%09%09%09%09%28function%28d%29%7Bvar%20v%3Dd.getElementById%28%27movie_player%27%29%3Bif%28v%29%7Btry%7Bv.stopVideo%28%29%7Dcatch%7B%7D%7D%0A%09%09%09%09%09else%7Bv%3Dd.getElementsByTagName%28%27video%27%29%3Bif%28v%5B0%5D%29%7Bv%5B0%5D.src%3D%27%27%3Btry%7Bv%5B0%5D.load%28%29%7Dcatch%7B%7D%7D%3B%7D%7D%29%28currentWin.document%29%3B%0A%0A%09%09%09%09currentWin.document.getElementById%28%27eow-title%27%29.appendChild%28videoMovedbox%29%3B%0A%09%09%09%09return%20true%3B%0A%09%09%09%7D%3B%0A%09%09%09for%20%28i%20%3D%200%3B%20i%20%3C%20elem.length%3B%20i++%29%20%7B%0A%09%09%09%09if%20%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%0A%0A%09%09%09%09%09if%20%28SEND%28tmp%29%29%20return%3B%0A%0A%09%09%09%09%09videoMovedbox%20%3D%20currentWin.document.createElement%28%27videoMoved%27%29%3B%0A%09%09%09%09%09videoMovedbox.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%0A%0A%09%09%09%09%09if%20%28currLoc.hostname%20%3D%3D%20%27www.youtube.com%27%29%20%7B%0A%09%09%09%09%09%09elem%5Bi%5D.parentNode.parentNode.appendChild%28videoMovedbox%29%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09elem%5Bi%5D.parentNode.appendChild%28videoMovedbox%29%3B%0A%09%09%09%09%09%7D%3B%0A%09%09%09%09%09elem%5Bi%5D.src%20%3D%20%27%27%3B%0A%09%09%09%09%09try%20%7B%0A%09%09%09%09%09%09elem%5Bi%5D.load%28%29%0A%09%09%09%09%09%7D%20catch%20%28e%29%20%7B%7D%3B%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0A%09%09currentWin._elems%20%3D%20currentWin.document.getElementsByTagName%28%27iframe%27%29%3B%0A%09%09if%20%28currentWin._elems.length%20%3E%200%29%20%7B%0A%09%09%09for%20%28currentWin._iCounter%20%3D%200%3B%20currentWin._iCounter%20%3C%20currentWin._elems.length%3B%20currentWin._iCounter++%29%20%7B%0A%09%09%09%09if%20%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%0A%0A%09%09%09%09if%20%28SEND%28%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%29%20return%3B%0A%0A%09%09%09%09currentWin._elems%5BcurrentWin._iCounter%5D.outerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%09%7D%3B%0A%09%09%09%09if%20%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%29%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%0A%09%09elem%20%3D%20currentWin.document.getElementsByTagName%28%27object%27%29%3B%0A%09%09currLoc%20%3D%20currentWin.location%3B%0A%09%09if%20%28elem.length%20%3D%3D%200%29%20%7B%0A%09%09%09elem%20%3D%20currentWin.document.getElementsByTagName%28%27embed%27%29%0A%09%09%7D%3B%0A%09%09if%20%28elem.length%20%3E%200%29%20%7B%0A%09%09%09for%20%28i%20%3D%200%3B%20i%20%3C%20elem.length%3B%20i++%29%20%7B%0A%09%09%09%09if%20%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%0A%0A%09%09%09%09%09if%20%28SEND%28%27https%3A//www.youtube.com/watch%3Fv%3D%27%20+%20tmp%5B1%5D%29%29%20return%3B%0A%0A%09%09%09%09%09elem%5Bi%5D.outerHTML%20%3D%20ytIMGouter%28tmp%5B1%5D%29%3B%0A%09%09%09%09%09return%20true%3B%0A%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09if%20%28elem%5Bi%5D.clientWidth%20%3E%2080%20%26%26%20elem%5Bi%5D.clientHeight%20%3E%2040%29%20%7B%0A%09%09%09%09%09%09if%20%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%0A%0A%09%09%09%09%09%09%09if%20%28SEND%28tmp%29%29%20return%3B%0A%0A%09%09%09%09%09%09%09elem%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%0A%09%09%09%09%09%09%09return%20true%3B%0A%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%7D%3B%0A%09%09%09%09%7D%0A%09%09%09%7D%3B%0A%09%09%7D%3B%0A%09%09return%20false%3B%0A%09%7D%3B%0A%0A%09function%20restProtHost%28lnkR%2C%20curLoc%29%20%7B%0A%09%09if%20%28lnkR.length%20%3D%3D%200%29%0A%09%09%09return%20%27%27%3B%0A%09%09let%20tr%20%3D%20lnkR.replace%28/%5E%3A%5C/%5C//%2C%20curLoc.protocol%20+%20%22//%22%29%3B%0A%09%09if%20%28%21tr.match%28/%5Ehttps%3F%3A%5C/%5C//i%29%29%20%7B%0A%09%09%09lnkR%20%3D%20tr.replace%28/%5E%5C/+/%2C%20%27%27%29%3B%0A%09%09%09if%20%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%20%7B%0A%09%09%09%09tr%20%3D%20curLoc.protocol%20+%20%27//%27%20+%20lnkR%3B%0A%09%09%09%7D%20else%20%7B%0A%09%09%09%09tr%20%3D%20curLoc.protocol%20+%20%27//%27%20+%20curLoc.host%20+%20%22/%22%20+%20lnkR%3B%0A%09%09%09%7D%0A%09%09%7D%3B%0A%09%09return%20tr%3B%0A%09%7D%3B%0A%0A%09function%20getSrc%28vobj%2C%20currentLoc%29%20%7B%0A%09%09var%20t%20%3D%20%27%27%2C%0A%09%09tt%20%3D%20%27%27%3B%0A%09%09if%20%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%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%29%20%7B%0A%09%09%09if%20%28tt.indexOf%28%22.mp4/%3F%22%29%20%3D%3D%20-1%29%20%7B%0A%09%09%09%09tt%20%3D%20tt.replace%28/%26amp%3B/g%2C%20%22%26%22%29%0A%09%09%09%7D%3B%0A%09%09%09t%20%3D%20restProtHost%28tt%2C%20currentLoc%29%3B%0A%09%09%09return%20t%3B%0A%09%09%7D%3B%0A%09%09return%20%27%27%3B%0A%09%7D%3B%0A%0A%09function%20getLink%28obj%2C%20curLocation%29%20%7B%0A%0A%09%09if%20%28%21obj%20%7C%7C%20%21obj.tagName%29%0A%09%09%09return%20%27%27%3B%0A%09%09q%20%3D%20obj.tagName.toLowerCase%28%29%3B%0A%0A%09%09var%20getParam%20%3D%20function%20%28e%2C%20n%29%20%7B%0A%09%09%09var%20v%20%3D%20%27%27%2C%0A%09%09%09r%20%3D%20new%20RegExp%28%27%5E%28%27%20+%20n%20+%20%27%29%24%27%2C%20%27i%27%29%2C%0A%09%09%09param%20%3D%20e.getElementsByTagName%28%27param%27%29%3B%0A%09%09%09for%20%28var%20igp%20%3D%200%2C%20p%3B%20p%20%3D%20param%5Bigp%5D%3B%20igp++%29%20%7B%0A%09%09%09%09if%20%28p.hasAttribute%28%27name%27%29%20%26%26%20p.getAttribute%28%27name%27%29.match%28r%29%29%20%7B%0A%09%09%09%09%09v%20%3D%20p.getAttribute%28%27value%27%29%3B%0A%09%09%09%09%09break%0A%09%09%09%09%7D%3B%0A%09%09%09%7D%3B%0A%09%09%09return%20v%3B%0A%09%09%7D%3B%0A%0A%09%09var%20restPath%20%3D%20function%20%28f%2C%20s%29%20%7B%0A%09%09%09return%20%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%09%09%7D%3B%0A%0A%09%09function%20videoLinkExtract%28fl%29%20%7B%0A%09%09%09alert%28fl%29%3B%0A%09%09%09var%20linkArr%20%3D%20%5B%5D%2C%0A%09%09%09outLinks%20%3D%20%5B%5D%2C%0A%09%09%09jj%20%3D%200%2C%0A%09%09%09lba%20%3D%20%27%27%2C%0A%09%09%09lbb%20%3D%20%27%27%2C%0A%09%09%09decodeURL%20%3D%20gBrowser.currentURI.spec%3B%20%7B%0A%09%09%09%09try%20%7B%0A%09%09%09%09%09return%20decodeURIComponent%28s%29%0A%09%09%09%09%7D%20catch%20%28e%29%20%7B%0A%09%09%09%09%09return%20unescape%28s%29%0A%09%09%09%09%7D%0A%09%09%09%7D%3B%0A%0A%09%09%09for%20%28var%20ij%20%3D%200%3B%20ij%20%3C%203%3B%20ij++%29%20%7B%0A%09%09%09%09lba%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%0A%09%09%09%09lbb%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%09%09%09%7D%3B%0A%0A%09%09%09function%20pushWithMerit%28lnk%29%20%7B%0A%0A%09%09%09%09var%20merit%20%3D%20-11%3B%0A%09%09%09%09if%20%28lnk.match%28/%5Ehttps%3F%3A%5C/%5C//i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%2040%3B%0A%09%09%09%09if%20%28outLinks.length%20%3D%3D%200%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%201%3B%0A%09%09%09%09if%20%28lnk.match%28/%5E%5C//%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%207%3B%0A%09%09%09%09if%20%28lnk.match%28/%5E%5C/%5C//%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%2030%3B%0A%09%09%09%09if%20%28lnk.match%28/240p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%201%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D240%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%201%3B%0A%09%09%09%09if%20%28lnk.match%28/360p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%203%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D360%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%203%3B%0A%09%09%09%09if%20%28lnk.match%28/480p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%205%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D480%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%205%3B%0A%09%09%09%09if%20%28lnk.match%28/720p%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%207%3B%0A%09%09%09%09if%20%28lnk.match%28/%5B%5Ea-z%5D720%28%5B%5Ea-z0-9%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%207%3B%0A%09%09%09%09if%20%28lnk.match%28/%5C.mp4%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%208%3B%0A%09%09%09%09if%20%28lnk.match%28/_hd%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20+%206%3B%0A%09%09%09%09if%20%28lnk.match%28/%5C.%28jpg%7Cxml%29%28%5B%5Ea-z%5D%7C%24%29/i%29%29%0A%09%09%09%09%09merit%20%3D%20merit%20-%2040%3B%0A%09%09%09%09if%20%28merit%20%3E%200%29%0A%09%09%09%09%09outLinks.push%28merit%20+%20lba%20+%20lnk%29%3B%0A%09%09%09%09Services.console.logStringMessage%28%27merit%3A%27%20+%20merit%20+%20%27%20lnk-%3E%27%20+%20lnk%29%3B%0A%09%09%09%7D%3B%0A%0A%09%09%09linkArr.push%28fl%29%3B%0A%09%09%09while%20%28linkArr.length%20%3E%20jj%20%26%26%20jj%20%3C%2030%29%20%7B%0A%0A%09%09%09%09var%20testPaths%20%3D%20%5B%5D%3B%0A%09%09%09%09testPaths%20%3D%20linkArr%5Bjj%5D.split%28/%28%5C.%28%3F%3Aflv%7Cmp4%7Cm3u8%29%29/i%29%3B%0A%09%09%09%09if%20%28testPaths%5BtestPaths.length%20-%201%5D%20%3D%3D%20%27%27%29%0A%09%09%09%09%09testPaths.pop%28%29%3B%0A%0A%09%09%09%09for%20%28k%20%3D%201%3B%20k%20%3C%20testPaths.length%3B%20k%20%3D%20k%20+%202%29%20%7B%0A%0A%09%09%09%09%09if%20%28testPaths%5Bk%20-%201%5D.indexOf%28lba%29%20%3E%20-1%29%20%7B%0A%09%09%09%09%09%09pref%20%3D%20testPaths%5Bk%20-%201%5D%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09var%20testAboutDom%20%3D%20testPaths%5Bk%20-%201%5D.toLowerCase%28%29.split%28/%28https%3F%3A%5C/%5C/%29/%29%3B%0A%09%09%09%09%09%09if%20%28testAboutDom%5BtestAboutDom.length%20-%201%5D%20%3D%3D%20%27%27%29%0A%09%09%09%09%09%09%09testAboutDom.pop%28%29%3B%0A%09%09%09%09%09%09var%20pTest%20%3D%20testAboutDom%5BtestAboutDom.length%20-%201%5D.split%28/%28%5C%3F%5B%5E%5C%3F%5D*%3F%26%29/%29%3B%0A%09%09%09%09%09%09if%20%28pTest.length%20%3E%202%29%20%7B%0A%09%09%09%09%09%09%09pTest.pop%28%29%3B%0A%09%09%09%09%09%09%09pTest.pop%28%29%3B%0A%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09testAboutDom%5BtestAboutDom.length%20-%201%5D%20%3D%20pTest.join%28%27%27%29%3B%0A%09%09%09%09%09%09pref%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%09%09%09%09%09%7D%3B%0A%0A%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28lbb%29%3B%0A%09%09%09%09%09if%20%28t2%20%3E%20-1%29%20%7B%0A%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%203%29%3B%0A%09%09%09%09%09%7D%20else%20%7B%0A%0A%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28%27%7B%22%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28%27%5B%22%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28%27%2C%22%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%202%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%22http%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%22https%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%2Chttp%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%2Chttps%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%3Bhttp%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27*https%3A//%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09t2%20%3D%20pref.toLowerCase%28%29.lastIndexOf%28%27%20or%20%27%29%3B%0A%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%204%29%3B%0A%0A%09%09%09%09%09%09pref%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%09%09%09%09%09%7D%0A%0A%09%09%09%09%09if%20%28pref.length%20%3E%200%29%20%7B%0A%0A%09%09%09%09%09%09if%20%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%0A%09%09%09%09%09%09%09t2%20%3D%20pref.indexOf%28%27%22%27%29%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%201%29%3B%0A%09%09%09%09%09%09%09%09suff%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%0A%09%09%09%09%09%09%09if%20%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%0A%09%09%09%09%09%09%09%09if%20%28testPaths.length%20%3E%20k%20+%201%29%20%7B%0A%09%09%09%09%09%09%09%09%09testPaths%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%09%09%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28lba%29%3B%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%203%29%0A%09%09%09%09%09%09%09%09%09%09linkArr.push%28decodeURL%28pref%20+%20testPaths%5Bk%5D%20+%20suff%29%29%3B%0A%0A%09%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09%09testPaths%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%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09suff%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%0A%09%09%09%09%09%09%09t2%20%3D%20suff.indexOf%28%27%26%27%29%3B%0A%09%09%09%09%09%09%09if%20%28%28t2%20%3E%20-1%29%20%26%26%20%28pref%20%21%3D%20testPaths%5Bk%20-%201%5D%29%29%20%7B%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3D%3D%200%29%0A%09%09%09%09%09%09%09%09%09suff%20%3D%20%27%27%3B%0A%09%09%09%09%09%09%09%09if%20%28suff.charAt%280%29%20%21%3D%20%27%3F%27%29%0A%09%09%09%09%09%09%09%09%09suff%20%3D%20suff.split%28/%28%26%5B%5E%26%5D+%3Dhttps%3F%3A%5C/%5C/%29/i%29%5B0%5D%3B%0A%09%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09%09if%20%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%0A%09%09%09%09%09%09%09%09if%20%28testPaths.length%20%3E%20k%20+%201%29%20%7B%0A%09%09%09%09%09%09%09%09%09testPaths%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%09%09%09%09%09%09%09%09%7D%3B%0A%09%09%09%09%09%09%09%09t2%20%3D%20pref.lastIndexOf%28lba%29%3B%0A%09%09%09%09%09%09%09%09if%20%28t2%20%3E%20-1%29%0A%09%09%09%09%09%09%09%09%09pref%20%3D%20pref.substring%28t2%20+%203%29%3B%0A%09%09%09%09%09%09%09%09pushWithMerit%28pref%20+%20testPaths%5Bk%5D%20+%20suff%29%3B%0A%0A%09%09%09%09%09%09%09%7D%20else%20%7B%0A%09%09%09%09%09%09%09%09testPaths%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%09%09%09%09%09%09%09%7D%0A%09%09%09%09%09%09%7D%0A%09%09%09%09%09%7D%0A%09%09%09%09%7D%3B%0A%09%09%09%09jj%20%3D%20jj%20+%201%3B%0A%09%09%09%7D%3B%0A%0A%09%09%09if%20%28outLinks.length%20%3D%3D%200%29%0A%09%09%09%09return%20%27%27%3B%0A%09%09%09function%20srt%28a%2C%20b%29%20%7B%0A%09%09%09%09a%20%3D%20parseInt%28a.substr%280%2C%20a.indexOf%28lba%29%29%2C%2010%29%3B%0A%09%09%09%09b%20%3D%20parseInt%28b.substr%280%2C%20b.indexOf%28lba%29%29%2C%2010%29%3B%0A%09%09%09%09if%20%28a%20%3C%20b%29%0A%09%09%09%09%09return%201%3B%0A%09%09%09%09if%20%28a%20%3E%20b%29%0A%09%09%09%09%09return%20-1%3B%0A%09%09%09%09return%200%0A%09%09%09%7D%3B%0A%09%09%09outLinks.sort%28srt%29%3B%0A%09%09%09outLinks%5B0%5D%20%3D%20outLinks%5B0%5D.substr%28outLinks%5B0%5D.indexOf%28lba%29%20+%203%29%0A%09%09%09%09if%20%28outLinks%5B0%5D.indexOf%28%27_hq.mp4/%3Ftime%3D%27%29%20%3E%200%29%0A%09%09%09%09%09outLinks%5B0%5D%20%3D%20outLinks%5B0%5D.replace%28/%26/g%2C%20%27%26amp%3B%27%29%3B%0A%09%09%09%09return%20outLinks%5B0%5D%3B%0A%09%09%7D%3B%0A%0A%09%09if%20%28%21ol%29%0A%09%09%09return%20%27%27%3B%0A%09%09//ol%20%3D%20ol.replace%28/%5E%3A%3F%5C/%5C//%2C%20curLocation.protocol%20+%20%22//%22%29%3B%0A%09%09//return%20restPath%28ol%2C%20src%29%3B%0A%09%09return%20restProtHost%28ol%2C%20curLocation%29%3B%0A%09%7D%3B%0A%0A%09try%20%7BhandlWin%28content%29%3B%7D%20finally%20%7Bfound%20%7C%7C%20SEND%28%29%3B%7D%0A%7D%29%3B%0A%0A%20var%20style%20%3D%20custombutton.buttonGetHelp%28self%29.replace%28/id/g%2C%20_id%29%3B%0Avar%20uri%20%3D%20makeURI%28%27data%3Atext/css%2C%27+%20encodeURIComponent%28style%29%29%3B%0Avar%20sss%20%3D%20Cc%5B%22@mozilla.org/content/style-sheet-service%3B1%22%5D.getService%28Ci.nsIStyleSheetService%29%3B%0Asss.loadAndRegisterSheet%28uri%2C%200%29%3B%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%0A%5D%5D%3E%3C/help%3E%0A%20%20%3Cattributes/%3E%0A%3C/custombutton%3E

Отсутствует

 

№1587705-09-2021 14:19:59

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

Подскажите команду для вызова Окна диалога выбора папки загрузки:

7ada1fb38c8277bcf7f3e49cea06ba6d.png


// Спасибо Dumby.

№15880

Отредактировано thrower (05-09-2021 21:27:56)

Отсутствует

 

№1587805-09-2021 20:31:12

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

Re: Custom Buttons

thrower пишет

Подскажите команду

Команду? В смысле, для страницы about:preferences?
Если, например, она в активной вкладке, то просто:
content.gMainPane.chooseFolder();


А если страницы нет, или просто независимо,
то надо всё добро оттуда с собой притащить,
приблизительно как-то так:

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

Выделить код

Код:

(async (dirp, listp) => {
	var desk = Services.dirsvc.get("Desk", Ci.nsIFile);
	var def = new FileUtils.File(await Downloads.getSystemDownloadsDirectory());

	var currentDirPref;
	var list = Services.prefs.getIntPref(listp);
	if (list == 0)
		currentDirPref = desk;
	else if (list == 1)
		currentDirPref = def;
	else try {
		currentDirPref = Services.prefs.getComplexValue(dirp, Ci.nsIFile);
	} catch {};

	var [title] = await new Localization(["browser/preferences/preferences.ftl"])
		.formatValues([{id: "choose-download-folder-title"}]);

	var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
	fp.init(window, title, fp.modeGetFolder);
	fp.appendFilters(fp.filterAll);

	fp.displayDirectory = currentDirPref?.exists()
		? currentDirPref : def?.exists() ? def : desk;

	var res = await new Promise(fp.open);
	if (res != fp.returnOK) return;

	var {file} = fp, eq = f => f && file.equals(f);
	Services.prefs.setIntPref(listp, eq(desk) ? 0 : eq(def) ? 1 : 2);
	Services.prefs.setComplexValue(dirp, Ci.nsIFile, file);

})("browser.download.dir", "browser.download.folderList");

Отсутствует

 

№1587905-09-2021 21:16:38

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

Dumby
Поставил в жест сложный код. Великолепно работает!

Думал найти и запихнуть какой-нибудь простой код типа
document.getElementById("about:preferences").content.gMainPane.chooseFolder()
а потом вспомнил, что XUL и xhtml - это разные вещи.

Отсутствует

 

№1588006-09-2021 11:59:46

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 28
UA: Chrome 93.0

Re: Custom Buttons

Я хочу установить плагин через отладку, в версии лисы 56.0.2 работает плагин (можно установить не через отладку), а в 57 нет, поэтому хотел установить через отладку и вот такая ошибка (см. скрин).00a4fc8b5a56.png

Отредактировано Senflex (06-09-2021 12:01:11)

Отсутствует

 

№1588107-09-2021 18:17:59

Black_Monk
Участник
 
Группа: Members
Зарегистрирован: 18-02-2012
Сообщений: 146
UA: Firefox 92.0

Re: Custom Buttons

После обновления на [firefox]-92 расширение в очередной раз исчезло из браузера. :angry: Версия custom_buttons-0.0.7.0.0.17-fx-paxmod.
Какие способы возвращения возможны? Или надо просто версию обновить?


Windows 10 LTSC

Отсутствует

 

№1588207-09-2021 18:22:12

sonyas75
Участник
 
Группа: Members
Откуда: Ставрополь
Зарегистрирован: 22-03-2011
Сообщений: 503
UA: Firefox 91.0

Re: Custom Buttons

Black_Monk
может эту поставить? Custom Buttons 0.0.7.0.0.19 https://forum.mozilla-russia.org/viewtopic.php?pid=793488#p793488

Отсутствует

 

№1588307-09-2021 18:30:41

Black_Monk
Участник
 
Группа: Members
Зарегистрирован: 18-02-2012
Сообщений: 146
UA: Firefox 92.0

Re: Custom Buttons

sonyas75, спасибо, заработало! :)


Windows 10 LTSC

Отсутствует

 

№1588408-09-2021 11:20:21

ВВП
Участник
 
Группа: Members
Зарегистрирован: 13-03-2021
Сообщений: 150
UA: Firefox 92.0

Re: Custom Buttons

Dumby
Снят вопрос.

Отредактировано ВВП (09-09-2021 13:57:56)

Отсутствует

 

№1588509-09-2021 21:07:06

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 28
UA: Chrome 93.0

Re: Custom Buttons

Можно ли программно из браузера узнать ping сайта?

Отсутствует

 

№1588609-09-2021 22:40:32

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

Re: Custom Buttons

Senflex

скрытый текст
j4AGV0z.png

Отсутствует

 

№1588709-09-2021 23:34:45

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 28
UA: Chrome 93.0

Re: Custom Buttons

vitalii201 пишет

Senflex

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

Я совсем новичок в CB, пожалуйста подскажите, код.

Отсутствует

 

№1588809-09-2021 23:44:27

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

Re: Custom Buttons

Senflex пишет

в CB

Mea culpa – не обратил внимание, что ветка "Custom Buttons". На скрине настройки FlagFox.

Отсутствует

 

№1588910-09-2021 11:55:15

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 28
UA: Chrome 93.0

Re: Custom Buttons

vitalii201 пишет
Senflex пишет

в CB

Mea culpa – не обратил внимание, что ветка "Custom Buttons". На скрине настройки FlagFox.

Благодарю! Посмотрю... Ещё руки не дошли(

Отсутствует

 

№1589011-09-2021 15:07:56

vv07
Участник
 
Группа: Members
Зарегистрирован: 07-11-2007
Сообщений: 661
UA: unknown 0.0

Re: Custom Buttons

Уважаемые гуру! Не смогли бы вы, отредактировать кнопку User-agent change, так что бы
изменения сохранялись постоянно, пока сам не вернешь обратно. А то не очень удобно, когда
после перезагрузки, изменение отключается.

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

Выделить код

Код:

var ps = Components. classes ["@mozilla.org/preferences-service;1"]. getService (Components. interfaces. nsIPrefService). getBranch ("general.");
    ps. setCharPref ("useragent.override", "reset");

this.PS = Components.classes['@mozilla.org/preferences-service;1'] .getService(Components.interfaces.nsIPrefBranch);
this.PS.clearUserPref("general.useragent.override");
this.image=
'data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD///8A////AJkyAACZMwAAmTIAAJcwAACUKQBAqVIh1J48CX6YMAAAmTMAAJkzAACZMwAAmDEAAP///wD///8A////AP///wCZMgAAmTMAAJQqABadNwiRz45Y+fTUo/+fPgyKlSoAAJcvAACZMgAAmTMAAJgxAAD///8A////AP///wD///8Aly8AAZUvAV65Xyji8LBn///XiP/6xoD/r1wq56hRIcmkSxm7ljEBcZcwAAeZMQAA////AP///wD///8A////AKFCEcfhkkn//7VY//+vUP//qEn//7BY//+5Yv//uF7//LVd/92NQ/+fPAq4li8AC////wD///8A////AP///wCdOQiLyGYe8vieP///rkz//6ZE//6nS//vkTj/7Ywz//qcPf//tFD/4og3/5gwAIb///8A////AP///wD///8AmDEAAJMrACikQQ2w2o9J///RgP/8xHn/oD4LyZYvAYmjPwzH8bNn///Zh/+0WiDn////AP///wD///8A////AJkyAACZMgAAli4AAJQrAFa3ZjDb5rp9/6JCDoqXLgAAkykALbhoMf/Wpmr/sVsl/////wD///8A////AP///wCZMwAAmTMAAJkzAACZMgAAlCsAEZo3BIiaNAFPmTMAAJo0AAeWLgBGkykASpcwAEX///8A////AP///wD///8AmDEAU5QqAFmWLgBXmjQADJkzAACaNQJJnj0Km5QqAB+ZMQAAmTMAAJkzAACZMwAA////AP///wD///8A////ALBZI//dr3H/wHU9/5IpAECWLgAAnjsIeem9gP/Bdz7qli8BbZUtAAOZMgAAmTIAAP///wD///8A////AP///wCtUBff/858//e6a/+qSRLYmTIEmaA9CMr3um///9J//+ObUf+rShPFkysAPJcwAAD///8A////AP///wD///8AlS4Acth8L///tE///6E///OSNv/0lTn//qVJ//+jQP//q0j//aNB/9JyJf2fPQug////AP///wD///8A////AJcvAAObNgaf1II9//eyXv/+tmD//rdj//+zXf//q0z//7JU//+1Wf/fkUn/okMSv////wD///8A////AP///wCYMAAAmDEAAJUuAFugQxKqpEoauqhRINz2xID//9qM/+6vZ/+2XCXelC4AWZcwAAD///8A////AP///wD///8AmDAAAJkzAACZMwAAlzAAAJYsAACcOAZ47sub/8yLVvWbNQaKlCsAEpkyAACZMwAA////AP///wD///8A////AJgwAACZMwAAmTMAAJkzAACYMQAAnDkGbqZMG9STKQA8ly8AAJkzAACZMgAAmTMAAP///wD///8A/H8AAPB/AADABwAAwAMAAMADAADgAwAA+EMAAPxDAADCPwAAwg8AAMAHAADAAwAAwAMAAPAHAAD+DwAA/j8AAA==';


var меню =
'<menupopup xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"\n\
       oncommand="this.parentNode.сменитьЮзерагент(event)">\n\
          <menuitem type="radio" value="reset" label="Default User-Agent"/>\n\
          <menuseparator/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0) Gecko/20100101 Firefox/40.0 " label="Firefox 40.0"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Firefox/78.0 " label="Firefox 78.0"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (compatible, MSIE 11, Windows NT 6.3; Win64; x64; Trident/7.0; rv:11.0) like Gecko" label="Win8.1 x64 IE-11.0"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0 Safari/537.36" label="Chrome 43.0"/>\n\
    <menuitem type="radio" value="Opera/9.80 (X11; Linux i686; Ubuntu/14.10) Presto/2.12.388 Version/12.16" label="Opera 12.16 / Linux"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (Android 4.2; Linux armv7l; rv:9.0) Gecko/20111216 Firefox/38.0 Fennec/38.0" label="Android 4.2 / Fennec 38.0"/>\n\
    <menuitem type="radio" value="AppEngine-Google; (+http://code.google.com/appengine; appid: unblock4myspace)" label="AppEngine-Google"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.15 YB/3.5.1" label="FF 3.6.15+yandexbar"/>\n\
    <menuitem type="radio" value="iCab/3.0.2 (Macintosh; U; PPC Mac OS)" label="iCab/Mac"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (X11; Linux x86_64; rv:2.0b6pre) Gecko/20100401 Firefox/38.0.1" label="Firefox-38.0.1 / Linux"/>\n\
    <menuitem type="radio" value="AmigaVoyager/3.2 (AmigaOS/MC680x0)" label="AmigaVoyager"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.3) Gecko/20090914 Slackware/13.0_stable Firefox/3.5.3" label="Slackware"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; ru; rv:1.9.2.3) Gecko/20100401 Firefox/38.0.1" label="Firefox-38.0.1 Mac OS"/>\n\
    <menuitem type="radio" value="NCSA Mosaic/1.0 (X11;SunOS 4.1.4 sun4m)" label="NCSA Mosaic-1.0 / SunOS 4.1.4"/>\n\
    <menuitem type="radio" value="NetSurf/2.0 (RISC OS; armv5l; NetSurf/2.0)" label="NetSurf-2.0 RISC OS"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (BeOS; U; Haiku BePC; en-US; rv:38.0.1.1) Gecko/20080112" label="Mozilla-38.0.1 / BeOS"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (OS/2; U; Warp 4.5; en-US; rv:1.8.1.3pre) Gecko/20070307" label="Mozilla/5.0 OS/2"/>\n\
    <menuitem type="radio" value="Mozilla/5.0 (PLAYSTATION 3; 2.00)" label="Mozilla/5.0 (PLAYSTATION 3; 2.00)"/>\n\
    <menuitem type="radio" value="Links (6.9; Unix 6.9-astral sparc; 80x25)" label="Links / Unix"/>\n\
</menupopup>';


меню = e4xConv_parseXULFromString (меню);
меню. childNodes [0]. setAttribute ("checked", "true");
this. orient = "horizontal";
this. type = "menu";
this. appendChild (меню);
this. сменитьЮзерагент = function (событие)
{
    var юзерагент = событие. target. getAttribute ("value");
       var ps = Components. classes ["@mozilla.org/preferences-service;1"]. getService (Components. interfaces. nsIPrefService). getBranch ("general.");
    ps. setCharPref ("useragent.override", юзерагент);
this.PS = Components.classes['@mozilla.org/preferences-service;1'] .getService(Components.interfaces.nsIPrefBranch);
this.pref='general.useragent.override';
var state=this.PS.getCharPref(this.pref);
if (state=="reset") { 
this.PS = Components.classes['@mozilla.org/preferences-service;1'] .getService(Components.interfaces.nsIPrefBranch);
this.pref='general.useragent.override';
var state=this.PS.getCharPref(this.pref);
this.PS = Components.classes['@mozilla.org/preferences-service;1'] .getService(Components.interfaces.nsIPrefBranch);
this.PS.clearUserPref("general.useragent.override"); 
this.image=
'data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAD///8A////AJkyAACZMwAAmTIAAJcwAACUKQBAqVIh1J48CX6YMAAAmTMAAJkzAACZMwAAmDEAAP///wD///8A////AP///wCZMgAAmTMAAJQqABadNwiRz45Y+fTUo/+fPgyKlSoAAJcvAACZMgAAmTMAAJgxAAD///8A////AP///wD///8Aly8AAZUvAV65Xyji8LBn///XiP/6xoD/r1wq56hRIcmkSxm7ljEBcZcwAAeZMQAA////AP///wD///8A////AKFCEcfhkkn//7VY//+vUP//qEn//7BY//+5Yv//uF7//LVd/92NQ/+fPAq4li8AC////wD///8A////AP///wCdOQiLyGYe8vieP///rkz//6ZE//6nS//vkTj/7Ywz//qcPf//tFD/4og3/5gwAIb///8A////AP///wD///8AmDEAAJMrACikQQ2w2o9J///RgP/8xHn/oD4LyZYvAYmjPwzH8bNn///Zh/+0WiDn////AP///wD///8A////AJkyAACZMgAAli4AAJQrAFa3ZjDb5rp9/6JCDoqXLgAAkykALbhoMf/Wpmr/sVsl/////wD///8A////AP///wCZMwAAmTMAAJkzAACZMgAAlCsAEZo3BIiaNAFPmTMAAJo0AAeWLgBGkykASpcwAEX///8A////AP///wD///8AmDEAU5QqAFmWLgBXmjQADJkzAACaNQJJnj0Km5QqAB+ZMQAAmTMAAJkzAACZMwAA////AP///wD///8A////ALBZI//dr3H/wHU9/5IpAECWLgAAnjsIeem9gP/Bdz7qli8BbZUtAAOZMgAAmTIAAP///wD///8A////AP///wCtUBff/858//e6a/+qSRLYmTIEmaA9CMr3um///9J//+ObUf+rShPFkysAPJcwAAD///8A////AP///wD///8AlS4Acth8L///tE///6E///OSNv/0lTn//qVJ//+jQP//q0j//aNB/9JyJf2fPQug////AP///wD///8A////AJcvAAObNgaf1II9//eyXv/+tmD//rdj//+zXf//q0z//7JU//+1Wf/fkUn/okMSv////wD///8A////AP///wCYMAAAmDEAAJUuAFugQxKqpEoauqhRINz2xID//9qM/+6vZ/+2XCXelC4AWZcwAAD///8A////AP///wD///8AmDAAAJkzAACZMwAAlzAAAJYsAACcOAZ47sub/8yLVvWbNQaKlCsAEpkyAACZMwAA////AP///wD///8A////AJgwAACZMwAAmTMAAJkzAACYMQAAnDkGbqZMG9STKQA8ly8AAJkzAACZMgAAmTMAAP///wD///8A/H8AAPB/AADABwAAwAMAAMADAADgAwAA+EMAAPxDAADCPwAAwg8AAMAHAADAAwAAwAMAAPAHAAD+DwAA/j8AAA==';

 }
 else { this.image=
'data:image/x-icon;base64,AAABAAEAEBAAAAEAIADkAgAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAFzUkdCAK7OHOkAAAAEZ0FNQQAAsY8L/GEFAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGHRFWHRTb2Z0d2FyZQBwYWludC5uZXQgNC4wLjOM5pdQAAACVUlEQVQ4T3WTMWhTURSG2zSaNqRRqU0N1MbUUGnStNDGtMagoqFFaR2qCELpoBUUFaQ4SV2kOKmDODrJm+Th9CYJDhK3ThLFIThlKpkkSCuvuX5/zJM3aODjvHty/v/ed867XW7LDXTxU4QkxCDo/myGKi9fLdnpCVP7WLno/nJz5KchA1MwBjEJuzsGQTiAMOH+aAYQDFWebho3EDRuOGLK6w9Nc7uxQP4KdddgAdIS9oJ270EY33pjGWd1Zds+X3Lt0dQfgw7OaGqX//eovQpZaWWgY2vHPnt1pVXzCf6HdaZoqL+PbkYGURb9lRfPZrd8RXVo+NYeZeCE59CdhLwMDmEwYo0M170ii8Y5N9bM63zONDu5dr5QVEMn0VyCSXRhGaRkYgWCvEjQ6BS19+XnNDNZfrL5Rblq7LBhIp8QLFN7llgixuGWDBLQXX1rT8AUTZpVMzUZjAo6SeNr9SY1MYQ5yMIR1v1w0DPQFAbhKMQp6GVkw86jDYPpEjmNd6z6zh7HdABC5IbguAzSUEAUgRNwD5Epd0bI/Hf1bdQ/VzNOIPit3QtAsw5ZGYTbJhyLo363Ly/u+BunRuojUgO9nE1P0DyGjAx6IEnRAzsa+VvkoVFqpN5az7yaNtQrTMtgv3a32Mkv/Bcys+ZLhibfRqNxRmUQYtFHzDCBoqPj+URaO5jzaRs+tg36MUPtsQ77ZDCgB8hjNEf3l/XOnkH7ueWu8d8i8TRRF+ku8Q4xIQONUBdKp1A/xiFW+1BOcJV3uJHXKT5FTrdvvhMvwJzbcgd/A3Q4lrpREVkLAAAAAElFTkSuQmCC';

 };
}
  

function e4xConv_parseXULFromString(xul) {
	xul = xul.replace(/>\s+</g, "><");
	return new DOMParser().parseFromString(xul, "application/xml").documentElement;
}

Отсутствует

 

№1589111-09-2021 20:01:25

Senflex
Участник
 
Группа: Members
Зарегистрирован: 18-07-2021
Сообщений: 28
UA: Chrome 93.0

Re: Custom Buttons

Приветствую всех!  Возник вопрос. Нужно вывести в alert число файлов в папке, к примеру путь C:\\FOTO

Отсутствует

 

№1589217-09-2021 22:58:41

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

Подскажите код, с помощь которого выполняется Removing cookies and site data:

e4831681d3b0d4d63083e6475eb53cad.png


//

Выделить код

Код:

SiteDataManager.remove(gBrowser.contentPrincipal.baseDomain);

Спасибо Dumby.
№15897

Отредактировано thrower (18-09-2021 20:16:45)

Отсутствует

 

№1589317-09-2021 23:35:53

unter_officer
Участник
 
Группа: Members
Откуда: Санкт-Петербург
Зарегистрирован: 27-03-2011
Сообщений: 254
UA: Firefox 52.0

Re: Custom Buttons

thrower пишет

Подскажите код, с помощь которого выполняется Removing cookies and site data:

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

Выделить код

Код:

/*Initialization Code*/

// Автор: Dumby (https://forum.mozilla-russia.org/viewtopic.php?pid=775136#p775136) .....
(obj => {
    this.setAttribute("context", "");
    this.onclick = e => obj[e.button < 2](e);
})({
    true(e) {
        var domain = this.domain();
        if (!domain) return;

        this.cookies(domain);
        this.webappstore(domain);
        this.macromedia();

        if (e.button) for(var br of gBrowser.browsers) try {
            this.domain(br) == domain && br.reload();
        } catch(ex) {}
    },
    false(e) {
        e.ctrlKey || e.shiftKey ? gShowPopup(self) : this.window();
    },
    domain(br = gBrowser.selectedBrowser, res) {
        try {
            res = new URL(br.currentURI.spec).hostname;
            res = res.includes(".")
                ? Services.eTLD.getBaseDomainFromHost(res)
                : undefined;
        } finally {return res;}
    },
    remove(...args) {
        (this.remove = Services.cookies.remove.length == 4
            ? Services.cookies.remove
            : (h, n, p, a) => Services.cookies.remove(h, n, p, false, a)
        )(...args);
    },
    cookies(domain, has) {
        for(var {host, name, path, originAttributes, rawHost} of (
            Services.cookies.enumerator || Services.cookies.cookies
        )) Services.eTLD.hasRootDomain(rawHost, domain)
            && this.remove(host, name, path, originAttributes);
    },
    webappstore(domain) {
        var db = FileUtils.getFile("ProfD", ["webappsstore.sqlite"]);
        var conn = Services.storage.openDatabase(db);
        conn.executeSimpleSQL(`DELETE FROM webappsstore2 WHERE scope LIKE "%${
            domain.split("").reverse().join("") + "."
        }%"`);
        conn.close();
    },
    macromedia() {
        var dir = Services.dirsvc.get("AppData", Ci.nsIFile);
        dir.append("Macromedia");
        dir.exists() && dir.isDirectory() && dir.remove(true);
        dir.create(dir.DIRECTORY_TYPE, 0o755);
    },
    get sdm() {
        this.url = "chrome://browser/content/preferences/dialogs/siteDataSettings.x" +
            (parseInt(Services.appinfo.platformVersion) <= 71 ? "ul" : "html");
        delete this.sdm;
        return this.sdm = ChromeUtils.import(
            "resource:///modules/SiteDataManager.jsm"
        ).SiteDataManager;
    },
    async window() {
        var domain = this.domain();
        var win = Services.wm.getMostRecentWindow("Browser:SiteDataSettings");
        win && win.close();

        await this.sdm.updateSites();
        win = openDialog(this.url, "_blank", "");
        if (!domain) return;

        await new Promise(resolve => 
            win.addEventListener("DOMContentLoaded", resolve, {once: true})
        );
        var list = win.document.getElementById("sitesList");
        list.clearSelection = () => {
            delete list.clearSelection;
            list.selectedIndex = 0;
            list.focus();
        }
        win.document.getElementById("searchBox").inputField.editor
            .insertText(domain);
    }
});

this.tooltipText = "Л: Удалить куки текущего сайта\
                  \nП: Управление куками для текущего сайта\
                  \nCtrl+П: CB Меню";

Отредактировано unter_officer (17-09-2021 23:37:55)


«The Truth Is Out There»

Отсутствует

 

№1589418-09-2021 02:47:22

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

unter_officer
Спасибо, но мне нужна не кнопка, а команда, равнозначная нажатию "Remove".

Отсутствует

 

№1589518-09-2021 11:40:53

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

Re: Custom Buttons

thrower
SiteDataManager.remove("litres.ru");

Отсутствует

 

№1589618-09-2021 14:06:39

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

Dumby
А как это сделать для произвольного текущего домена (активный таб)?

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

А еще вытащил код из background.js небольшого расширения, но тоже не получается его прицепить:

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

Выделить код

Код:

// Init
let browserName = "NonFirefox"; // Default value

// browser.runtime.getBrowserInfo() is not available
// https://github.com/mozilla/webextension-polyfill/issues/116

async function init(){
	// Get the browserName (likely will only work in case it's Firefox)
	if(browser.runtime.getBrowserInfo !== undefined){
		let info = await browser.runtime.getBrowserInfo();
		browserName = info.name;
	}
	
	// Events
	browser.browserAction.onClicked.addListener(async (tab) => {
		await deleteCookies(tab);
		await browser.tabs.reload();
		// Page was reloaded
	});
}

init();

// Functionality
async function deleteCookies(tab){	
	let cookies = await browser.cookies.getAll(
		getCookieQueryAll(tab)
	);

	let promises = cookies.map(cookie =>
		browser.cookies.remove(getCookieRemoveQuery(cookie))
	);

	return Promise.all(promises);
}

// Helper functions
function getCookieQueryAll(tab){
	let cookieQueryAll = {
		url: tab.url,
		storeId: tab.cookieStoreId
	};
	
	console.log("browserName is", browserName);
	if(browserName === "Firefox"){
		cookieQueryAll.firstPartyDomain = null;
	}
	
	console.log("cookieQueryAll", cookieQueryAll);
	
	return cookieQueryAll;
}

function getCookieRemoveQuery(cookie){
	let cookieRemoveQuery = {
		url: getCookieUrl(cookie),
		name: cookie.name,
		storeId: cookie.storeId
	};

	console.log("browserName is", browserName);
	if(browserName === "Firefox"){
		cookieRemoveQuery.firstPartyDomain = cookie.firstPartyDomain;
	}

	return cookieRemoveQuery;
}

function getCookieUrl(cookie) {
    let cookieProtocol = (cookie.secure) ? 'https://' : 'http://';
    return cookieProtocol + cookie.domain + cookie.path;
}

Отредактировано thrower (18-09-2021 14:08:42)

Отсутствует

 

№1589718-09-2021 18:17:43

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

Re: Custom Buttons

thrower пишет

А как это сделать для произвольного текущего домена (активный таб)?

Ну, для каких-то стандартных ситуаций, возможно, сойдёт и так:
SiteDataManager.remove(gBrowser.contentPrincipal.baseDomain);

Отсутствует

 

№1589818-09-2021 20:14:30

thrower
Участник
 
Группа: Members
Зарегистрирован: 28-11-2013
Сообщений: 207
UA: Firefox 91.0

Re: Custom Buttons

Dumby
Спасибо! Оно! Работает. То, что нужно.

Отсутствует

 

№1589922-09-2021 11:36:12

egorsemenov06
Участник
 
Группа: Members
Зарегистрирован: 12-06-2018
Сообщений: 260
UA: Firefox 92.0

Re: Custom Buttons

Dumby разделите пожауйста эту кнопку на отдельные  две кнопки

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

Выделить код

Код:

//Открыть внешнее win приложение........
try {((ext, data) => data.forEach(([id, impl]) => {
	impl.id = "ucf-cbbtn-" + id;
	CustomizableUI.createWidget(Object.assign(impl, ext))
}))({
	localized: false,
	onCreated(btn) {
		btn.owner = this;
		btn.type = "menu";
		btn.setAttribute("image", this.image);
		btn.openPopup = btn.openMenu;
		btn.openMenu = this.openMenu;

		var popup = btn.appendChild(btn.ownerDocument.createXULElement("menupopup"));
		popup.setAttribute("context", "");
		popup.setAttribute("oncommand", "owner.command(event)");

		this.init(btn, popup);
		var {openDelay, closeDelay} = this;
		this.autoOpenCloseFeature(btn.ownerGlobal, btn, openDelay, closeDelay);
	},
	file: Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile),
	openMenu(...args) {
		if (this.parentNode != this.domParent) {
			this.domParent = this.parentNode;
			this.owner.setPopupPosition(this);
		}
		this.openPopup(...args);
	},
	setPopupPosition(node) {
		if (node.matches(".widget-overflow-list > :scope"))
			var pos = "after_start";
		else var win = node.ownerGlobal, {width, height, top, bottom, left, right} =
			node.closest("toolbar").getBoundingClientRect(), pos = width > height
				? `${win.innerHeight - bottom > top ? "after" : "before"}_start`
				: `${win.innerWidth - right > left ? "end" : "start"}_before`;
		node.firstChild.setAttribute("position", pos);
	},
	// https://github.com/Infocatcher/Custom_Buttons/blob/master/code_snippets/autoOpenCloseMenu.js
	// Automatically open menu on mouse over (and hide it on mouse out)
	autoOpenCloseFeature(win, btn, openDelay = 200, closeDelay = 350) {
		var _openTimer = 0;
		var _closeTimer = 0;
		btn.onmouseover = function(e) {
			win.clearTimeout(_closeTimer);
			if(e.target == btn && closeOtherMenus()) {
				btn.open = true;
				return;
			}
			_openTimer = win.setTimeout(function() {
				btn.open = true;
			}, openDelay);
		};
		btn.onmouseout = function(e) {
			win.clearTimeout(_openTimer);
			_closeTimer = win.setTimeout(function() {
				if(!isContextOpened())
					btn.open = false;
			}, closeDelay);
		};
		function closeOtherMenus() {
			return win.Array.prototype.some.call(
				btn.parentNode.getElementsByTagName("*"),
				function(node) {
					if(
						node != btn
						&& win.XULElement.isInstance(node)
						// See https://github.com/Infocatcher/Custom_Buttons/issues/28
						//&& node.boxObject
						//&& node.boxObject instanceof Components.interfaces.nsIMenuBoxObject
						&& "open" in node
						&& node.open
						&& node.getElementsByTagName("menupopup").length
					) {
						node.open = false;
						return true;
					}
					return false;
				}
			);
		}
		function isContextOpened() {
			return inBtn(win.document.popupNode);
		}
		function inBtn(node) {
			for(; node; node = node.parentNode)
				if(node == btn)
					return true;
			return false;
		}
	}
}, Object.entries({

	OpenPageInOtherBrowser: {
		label: "Открыть страницу в другом браузере",
		image: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAACXBIWXMAAAsSAAALEgHS3X78AAAEgUlEQVQ4jU2TW2yTZQCG3+/7v/79266HraN1G8cNVoERNhk42BBmghiQBF3IMJnghYcbxUPEREiYF0bgihBREyNRQ4wENCwkBjlsyIA5WclWOe3ANrq2W1u6reu5/f//+7xQI8/tmzx5bx4yMjKCgYEByLIMAYBTirymEUYpbIrimkslzKXOpwLrV3NNceTAhZERNVfFC1mnNifGjO6i8NB4grCOjg7s378foBSVNju+3b6D+NUC/d43oGeK7dXLFlfu9BhKr244XObntvuvkPDURszNGiSjkhKTaYAtPO7tT15iQggAAASHVZJIs8sFlDqx69l1O4Lh+EeVddXPidrZN2XeZcDvswrGqnhBXXXowK2rRxtXGF0vy4XWzvOhG4wQ8o+IUCIAkYcoYrr+pXlqdo+nwQXR6BUk1WP13qhE5pRZX2cDMRRpn9U/LK870/egrfkZ66WCqir/P4IQakGHIad/LUaDbWrLIs2w+TbFyB16J75PDNg3I9V8XbKdO4GaEiffXWpqmZ8tN01Oq20ffLwuTv+1SOACvM7S+hcLtknbyzR56z0p2T9If3nYjmtTtSQV9BF51RqML1yOlP8hiQUfqU00va33RGD3a69fEZRQQgDoJmaAceu8t+/tWwxsDxK9o5OcOduICxE3ykvSSBUvhR66D1W/heyyGDG/GJLwxgSWb4q8NXh3xkgBEABQi6WqxvUr6neVzwHXbtJQO8dgQEWJG4gqZfDM3URZVzuml21DyRYdhk0JwutzWN0CT2OttJY6HApxWICG5uqad6qZVRry8s8j88j9YAJJi4JR5kZvnxfV1w+id8EupBreA1m5CNSVJZxRYTYT04JyuoTt2bNGb939KQjXthUNX8DJqAU/Oi1IbnFiY0UFgots2Onx4BQ/iC6sRX0sCclTBuR8EIQAnEAiRGYyM4MZ3PV06trz/Y81nM4UwZXOYLhlIbKPFdTHIzjh8+G3+FLkC1nU1uiQ2AMUIAlGOclnZR6OIcI4MTGiJzfoY4OlP0zbM1mJmx2KhHSxBe6KOKKBIdyOOFBpIHjaY8SOJV8AGT9ALKCEIDDBogODWj8DrBpJB+smxjPdV84Xeua3LjjCZUmzaBbmjffAVNGPl6pWIJGVYNW9KFE7IJgZah6abDYbfvq18HNsjocoVD8QuOWyrWzqyT1Qj4b/CPsU2cSy+bSWt+YwU4ihO9mJ7vhlNCndsBiMSGaYbmFWg7fX4D92OnEEACjJ+iEyYatTqI9qXBJ8x3yt492ROxQyQ07S5QLTcxmb/oKS0TebVS2dtOpWUSz19Rn9be2xV2eTPEQJqHTow70Q8T/X0vjjpuaaeRdnptPR/gujPekEXyOZjfN1JhOH0Ogn9gi15BTyKKDQ785lR949Htk7EVV7KAHlApyok5ehDn9lZdnJ9yU9l6Ys03X4ZMR/4GzCqtjleqnCXu1xs+IGU56MRrX43bHcWGimcJsQhADkhYAOAESdvIj80Dcw5vMYGQ7i4KlBdN4tIJEVIBD4L+knoRSAAPgT49/cEBl9hsIr+QAAAABJRU5ErkJggg==",
		tooltiptext: [
			"Л: Открыть меню с браузерами",
			"С: Добавить в меню новый браузер",
			"\nФункции кликов мыши для меню:",
				"\tЛ: Открыть страницу",
				"\tС: Добавить разделитель",
				"\tП: Удалить пункт меню или разделитель",
				"\tCtrl+П: Изменить название пункта меню",
			"Перетаскиванием можно передвигать пункты меню или разделители"
		].join("\n"),

		init(btn, popup) {
			btn.onauxclick = this.auxclick;
			popup.setAttribute("onpopupshowing", "this.shouldRebuild && owner.rebuild(this)");
			popup.ondragstart = this.dragstart;
			popup.shouldRebuild = true;
		},
		get markup() {
			try {var data = Cu.readUTF8URI(Services.io.newURI(
				`chrome://user_chrome_files/content/custom_scripts/${this.id}-data.txt`
			)).split("\n").filter(line => /\S/.test(line));}
			catch {var data = [
				"D:\\Програмное обеспечение\\Флешка загрузочная\\Windows 7 SP1\\Программы\\ChromePortable\\ChromePortable.exe>Chrome",
				"D:\\Програмное обеспечение\\Флешка загрузочная\\Windows 7 SP1\\Программы\\Opera_1217\\Opera\\launcher.exe>Opera",
				"C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe",
				"D:\\Програмное обеспечение\\Флешка загрузочная\\Windows 7 SP1\\Программы\\Microsoft Edge\\ProgramFiles\\msedge.exe",
			];}
			delete this.markup;
			return this.markup = this.dataToMarkup(data);
		},
		setMarkup(popup) {
			this.markup = popup.innerHTML;
			for(var {node} of CustomizableUI.getWidget(this.id).instances)
				if (node.firstChild != popup) node.firstChild.shouldRebuild = true;
			this.write(Array.from(popup.children,
				node => node.hasAttribute("value")
					? node.tooltipText + (node.value == "true" ? ">" + node.label : "")
					: "separator"
			).join("\n"));
		},
		dataToMarkup(data) {
			var markup = "";
			for(var str of data) markup += str == "separator"
				? "<menuseparator/>" : this.strToMenuitem(str);
			return markup;
		},
		repl: [/^./, c => c.toUpperCase()],
		strToMenuitem(str, ind = str.lastIndexOf(">")) {
			var name, val, path = str;
			if ((val = ind != -1))
				path = str.slice(0, ind),
				name = str.slice(ind + 1);
			else
				this.file.initWithPath(path),
				name = this.file.leafName.split(".")
					.shift().replace(...this.repl);

			return `<menuitem label="${name}" tooltiptext="${path}" value="${val}"`
				+ ` class="menuitem-iconic" image="moz-icon://file://${path}"/>`;
		},
		append(popup, xul = this.markup) {
			popup.append(popup.ownerGlobal.MozXULElement.parseXULToFragment(xul));
		},
		rebuild(popup) {
			popup.textContent = "";
			this.append(popup);
			delete popup.shouldRebuild;
		},
		auxclick(e) {
			var trg = e.target, popup = this.firstChild;
			if (trg == this && e.button == 1)
				return this.owner.addMenuitem(popup);

			else if (trg.parentNode != popup) return;

			if (e.button == 1) {
				var up = e.screenY < trg.screenY + trg.clientHeight/2;
				up = up ? trg.previousSibling : !trg.nextSibling;
				trg[up ? "before" : "after"](
					trg.ownerDocument.createXULElement("menuseparator")
				);
			} else {
				if (e.ctrlKey) {
					if (trg.nodeName.endsWith("r")) return;

					var name = this.owner.prompt(
						"Введите другое название пункта",
						trg.label, trg.ownerGlobal
					);
					if (name && name != trg.label)
						trg.label = name,
						trg.value = true;
				}
				else trg.remove();
			}
			this.owner.changeMarkup(popup);
		},
		prompt(msg, value, domWin) {
			var res = {value};
			return Services.prompt.wrappedJSObject.pickPrompter({
				domWin, modalType: Ci.nsIPrompt.MODAL_TYPE_WINDOW
			}).nsIPrompt_prompt(this.label, msg, res, null, {})
				? res.value : null;
		},
		addMenuitem(popup) {
			var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker);
			fp.appendFilters(fp.filterApps);
			fp.init(popup.ownerGlobal, "Укажите путь к программе", fp.modeOpen);
			fp.open(res => {
				if (res == fp.returnOK)
					this.append(popup, this.strToMenuitem(fp.file.path, -1)),
					this.setMarkup(popup);
			});
		},
		changeMarkup(popup) {
			popup.state == "open"
				? popup.addEventListener("popuphidden", this, {once: true})
				: this.setMarkup(popup);
		},
		handleEvent(e) {
			this[e.type](e);
		},
		popuphidden(e) {
			this.setMarkup(e.target);
		},
		dragstart(e) {
			var trg = e.target;
			if (trg.parentNode.nodeName != "menupopup") return;

			var {owner} = this.parentNode;
			var pn = trg.flattenedTreeParentNode;
			owner.dragData = {trg, pn, ns: trg.nextSibling};

			trg.style.cssText = "font-weight: bold; color: red;"
				+ "outline: 2px solid red; outline-offset: -2px;"
					.replace(/;/g, " !important;");
			var win = trg.ownerGlobal;
			win.setCursor("grabbing");
			pn.addEventListener("mousemove", owner);
			win.addEventListener("mouseup", owner, {once: true});
		},
		mousemove(e) {
			var trg = e.target, dtrg = this.dragData.trg;
			if (trg == dtrg) return;

			e.movementY > 0
				? trg.nextSibling != dtrg && trg.after(dtrg)
				: trg.previousSibling != dtrg && trg.before(dtrg);
		},
		mouseup(e) {
			e.preventDefault();
			var {trg, pn, ns} = this.dragData;
			delete this.dragData;
			trg.removeAttribute("style");
			trg.ownerGlobal.setCursor("auto");
			pn.removeEventListener("mousemove", this);
			trg.nextSibling != ns && this.changeMarkup(trg.parentNode);
		},

		command(e) {
			this.file.initWithPath(e.target.tooltipText);
			if (this.file.exists()) {
				var process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
				process.init(this.file);
				return process.run(false, [e.view.gBrowser.currentURI.spec], 1);
			}
			Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService)
				.showAlertNotification(this.image, this.label, "Файл не существует");
		},
		write(txt) {
			var file = Services.dirsvc.get("UChrm", Ci.nsIFile), CC = Components.Constructor;
			["user_chrome_files", "custom_scripts", this.id + "-data.txt"].forEach(file.append);
			var te = new (Cu.getGlobalForObject(Cu).TextEncoder)();
			var fos = CC("@mozilla.org/network/file-output-stream;1", "nsIFileOutputStream", "init")
				// MODE_{WRONLY, CREATE, TRUNCATE}, PERMS_FILE
				.bind(null, file, 0x02 | 0x08 | 0x20, 0o644, 0);
			var bos = CC("@mozilla.org/binaryoutputstream;1", "nsIBinaryOutputStream", "setOutputStream");

			(this.write = txt => {
				var stream = new fos();
				try {new bos(stream).writeByteArray(te.encode(txt));}
				catch(ex) {Cu.reportError(ex);}
				finally {stream.close();}
			})(txt);
		}
	},

	openExternalWinApplication: {
		label: "Открыть внешнее win приложение",
		image: "data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAQAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAMAAwQAKCImDyo4IWkYaBzFQ6xI8FG/V/VCq0jcGGQbkwAQACQAAAAAAAIAAwAAAAAAAAAAAAAAAAEAAAIAAgIAQy4iYp9YOuZUah3/QMJQ/nfxgP97+Yb/f/+L/m/7ev87v0L1BzwIawAAAAAAAgADAAAAAAEAAAIAAAAAQR4Ki7pwNP//tG79aXQg/CGwM/tL3lP+SeJU/krmVf5I5lT8ROZQ/SjIMf8DQgWFAAAAAAACAAMAAAAAMRoKX5hKHP/qoVT69JtU/WVsGP8RmyP/LMAz/ynHM/4ozTP8Jc4w+x/KK/sbxyn7Daoa/wAlA1QAAAEAAgAAA2o5G9GhVyT/z305/N54Nv9eWxTyAnMR6Qp+DvsIig//CpQR/wucE/8KnQ//CpkG/QedAf8FZADWAwIACigYIklrMln7h0VB/6dcJPvBaCz/XC8RlgABAAACDgAlABUANAAfAUsAKABeAz8RlAhfUvkDZnP/CFtw+gcXKklSLEeVlUiB/6VamPykYGD7o1wl/2A4H5YAAAAAAgEBBAAAAAAAAQMEAAAAAAUoVmcHcfT/AIL5+QCK//8BOZ2rXjJRsJtOhf/SgLr9zoK++5hbW/9AKhaGAAAAAAICAQYAAQACAAMDBwAAAAABLlprD4///wqh9/oJsf//Al7M1FsxT6ucUYf/1Iq//Oyd1vzYkMf/X0FVhQAAAAADAgMEAAAAAAACBAQBAAAAAC1aYRSQ//8lpPr6Irj//wtt1t5GJT2DmlCF/82Juvz2reH/8Kbb/eej1P9jR1t+AAAAAAMCAwQBAwUGAAAAAAYkV2wjkv//PLP7+jzE//8VaMXMHhAaP5FLff+4d6b++rno//iz5P/3suP88rLg/2hPYn8AAAAAAQAAAAgPYW1bXeD/PJL0/1DB/fxSy///EkiRlwAAAABqOFzBp16S/+ev2Pz/we///b7s//u86vr7wev/dFxfcgAJYmhxeP//lJH+/juS+/5q0f/+V7n4/AASODwAAAAAHA4YP5NMgP+6fKj9/Mzw/f3H8/7/y/X/7LvU811Ywd54gPv8r6z//puZ/P1Akff5g+L//y5hmZ8AAAAAAgECAwAAAAA1Gy5vmlGG/8iOuP3/1vX/8sfe811YxNZ6g/f5ubb9/a6u+/uvrfz8TZPt/1GFvMcAAQwNAQAAAAAAAAACAQEDAAAAACoVJVh/QW3umWuP7V5fzeSMk/j9zcn//7+//v7Av///o6Pz+yU2XH0AAwYKAQAAAAAAAQEAAAAAAAAAAAEBAQMAAAAADwkHFAcCKUsJGb3VO0vn9lRf5/RdZMzXRkmTmw4OKTUAAAAAAgIDAwABAQEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
		data: [
			["QTranslate", "C:\\Users\\Роман\\AppData\\Roaming\\Mozilla\\Firefox\\Profiles\\8sr9ujrx.default-release\\_QTranslate\\QTranslate.exe"],
			["Explorer", "C:\\windows\\explorer.exe"],
			null,
			["Cmd Prompt", "C:\\windows\\system32\\cmd.exe"],
			["Media Player", "C:\\Program Files\\Windows Media Player\\wmplayer.exe"],
			["Task Manager", "C:\\windows\\system32\\taskmgr.exe"],
			["Control Panel", "C:\\windows\\system32\\control.exe"],
			null,
			["Notepad", "C:\\windows\\notepad.exe"],
			["Calculator", "C:\\windows\\system32\\calc.exe"],
			["Virtual Keyboard", "C:\\windows\\system32\\OSK.exe"],
			["Character table", "C:\\windows\\system32\\charmap.exe"]
		],
		init(btn) {
			btn.tooltipText = btn.label;
			btn.ownerGlobal.Object.defineProperty(btn, "domParent", this);
		},
		configurable: true,
		get() {
			delete this.domParent;
			var doc = this.ownerDocument, df = doc.createDocumentFragment();
			for(var arr of this.owner.data) {
				if (!arr) {
					df.append(doc.createXULElement("menuseparator"));
					continue;
				}
				var menuitem = df.appendChild(doc.createXULElement("menuitem"));
				menuitem.className = "menuitem-iconic";
				menuitem.setAttribute("label", arr[0]);
				menuitem.setAttribute("image", "moz-icon://file://" + arr[1]);
			}
			this.firstChild.append(df);
		},
		command(e) {
			this.file.initWithPath(e.target.getAttribute("image").slice(18));
			this.file.launch();
		}
	}
}))} catch(ex) {Cu.reportError(ex);}

Отсутствует

 

№1590022-09-2021 13:05:29

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

Re: Custom Buttons

egorsemenov06
Не понял.
Этот код и создаёт «отдельные две кнопки».

Отсутствует

 

Board footer

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