diff --git a/README.md b/README.md index cff2cc6..d8e1261 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# [instantgram] v12.0.0 :fire: Rebirth of Instantgram -![GitHub release](https://img.shields.io/badge/release-v12.0.0-green) +# [instantgram] v12.1.0 :rocket: Launch to the moon +![GitHub release](https://img.shields.io/badge/release-v12.1.0-green) ![badge](https://img.shields.io/badge/for-instagram-yellow.svg?style=flat-square) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](http://standardjs.com/) @@ -39,6 +39,7 @@ With this version we support all modern browsers that have ECMAScript 2015 (es6) Read [CONTRIBUTING.md](CONTRIBUTING.md) for more information. :heart: ## Changelog +- v12.1.0 - [instangram] Support for the latest backend version of instagram. - v12.0.0 - [instangram] Rewrite of instantgram to support last backend of insta. \ Profile page bulk downloader dropped because insta deleted all api around them. Maybe there is a possibility in the future but unfortunately not now. diff --git a/dist/main.js b/dist/main.js index a881392..be161aa 100644 --- a/dist/main.js +++ b/dist/main.js @@ -1 +1 @@ -(()=>{"use strict";var e;function t(e){let t;t=null!==window&&void 0!==window?{top:window.pageYOffset,bottom:window.pageYOffset+window.innerHeight}:document.documentElement;const a=e.getBoundingClientRect(),o=a.y+window.pageYOffset,n=a.y+a.height+window.pageYOffset;if(t.top>n||t.bottomn)return 100;if(ot.bottom)return 100;const i=a.height;let l=i;ot.bottom&&(l-=n-t.bottom);const r=l/window.innerHeight*100;return Math.round(r)}!function(e){e.Image="IMAGE",e.Video="VIDEO",e.UNDEFINED="UNDEFINED"}(e||(e={}));class a{getName(){return"FeedScanner"}async execute(a,o){try{let n,i,l,r,d=null,s=e.UNDEFINED,c=!1,m=document.querySelector("main"),g="._aagv",p="._aahh",u="._aahi";if(null==d){m=document.querySelector("main section > div:first-child > div:last-child > div:first-child > div:first-child"),r=document.getElementsByTagName("article");let e=[];for(let a=0;a :nth-child(2) > :first-child ul > li:nth-child(2) img[crossorigin='anonymous']")||r[a].querySelector(":first-child > :nth-child(2) > :first-child ul > li:nth-child(2) video[crossorigin='anonymous']"):r[a].querySelector(":first-child > :nth-child(2) > [role=button] img[crossorigin='anonymous']")||r[a].querySelector(":first-child > :nth-child(2) video[crossorigin='anonymous']"),null!=o&&null!=typeof o.getBoundingClientRect()){let i=t(o);e.push({i1:a,mediaEl:o,elemVisiblePercentage:i,isCarousel:n})}else e.push({i1:a,mediaEl:o,elemVisiblePercentage:0,isCarousel:n})}let a=e.reduce(((e,t)=>e.elemVisiblePercentage>t.elemVisiblePercentage?e:t));l=r[a.i1],n=e[a.i1]}if(n.isCarousel){let t=Array.from(l.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=t&&t.length>0){let a=l.querySelectorAll(":first-child > div:nth-child(2) > div > div:nth-child(2) > div");for(let e=0;e=2&&(i=e),i==a.length-1){c=!0;break}i++;let o=t,n=i;for(let t=0;t img[src]`)||null!==l.querySelector(`${g} > img[srcset]`);t?(s=e.Video,d=l.querySelector("video")):a&&(s=e.Image,d=null!==l.querySelector(`${g} > img[srcset]`)?l.querySelector(`${g} > img[srcset]`):l.querySelector(`${g} > img[src]`))}o(false,d,s,a)}catch(e){console.error(this.getName()+"()",`[instantgram] ${a.VERSION}`,e),o(!1,null,a)}}}class o{getName(){return"PostScanner"}async execute(t,a,o){try{let n,i,l=a,r=!1,d=null,s=e.UNDEFINED,c=null,m=!1,g=document.querySelector("main"),p="._aagv",u="._aahh",h="._aahi";if(l?(i=document.querySelectorAll('[role="dialog"]')[1],r=0!==i.querySelectorAll(u).length||0!==i.querySelectorAll(h).length):(g=document.querySelector("section main > div > :first-child"),i=g.querySelector("article"),r=0!==i.querySelectorAll(u).length||0!==i.querySelectorAll(h).length),console.log(["$article",i]),r){let t=Array.from(i.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=t&&t.length>0){d=null,c=null;let a=i.querySelectorAll("article > :first-child > :first-child > :first-child > div:nth-child(2) > div");for(let e=0;e=2&&(n=e),n==a.length-1){m=!0;break}n++;for(let o=0;o img[src]`)||null!==i.querySelector(`${p} > img[srcset]`);t?(s=e.Video,d=i.querySelector("video")):a&&(s=e.Image,d=null!==i.querySelector(`${p} > img[srcset]`)?i.querySelector(`${p} > img[srcset]`):i.querySelector(`${p} > img[src]`))}o(false,d,s,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),o(!1,null,t)}}}class n{getName(){return"StoryScanner"}async execute(t,a){try{let o=null,n=e.UNDEFINED,i=document.querySelector("main");i=document.querySelector("body > div");let l=i.querySelectorAll("section > div > div > div");for(let t=0;t=1&&l[t].classList.length>1){let a=null!==l[t].querySelector("video"),i=null!==l[t].querySelector("div > div img[src]")||null!==l[t].querySelector("div > div img[srcset]");0,a&&i?(n=e.Video,o=l[t].querySelector("video")):i&&(n=e.Image,null!==l[t].querySelectorAll("img")[0]&&(o=l[t].querySelectorAll("img")[0]));break}}a(false,o,n,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),a(!1,null,t)}}}class i{constructor(e){if(this.modal=null,this.imageURL=e?.imageURL||"",this.heading=e?.heading||[""],this.headingStyle=e?.headingStyle||"",this.content=e?.content||[""],this.contentStyle=e?.contentStyle||"",this.buttonList=e?.buttonList||[],null==document.getElementById("instantgram-modal")){var t=document.createElement("style");t.id="instantgram-modal",t.innerHTML='.instantgram-modal-overlay{display:none!important;opacity:0!important;transition:all ease .1s!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1000!important;background:rgba(0,0,0,.65)!important;justify-content:center!important;align-items:center!important}.instantgram-modal{transition:width ease-in-out .1s!important;display:inline-block!important;width:400px!important;padding:1.6px!important;z-index:1001!important}.instantgram-modal select{margin-left:.8px!important;border:solid 1px #dbdbdb!important;border-radius:3px!important;color:#262626!important;outline:0!important;padding:3px!important;text-align:center!important}@media (min-width:736px){.instantgram-modal{width:500px!important}}.instantgram-modal-content{position:relative;display:flex;flex-direction:column;width:100%!important;pointer-events:auto!important;background-clip:padding-box!important;outline:0!important}.instantgram-modal-header{color:#fff!important;background-color:#fd1d1d!important;background-image:linear-gradient(45deg,#405de6,#5851db,#833ab4,#c13584,#e1306c,#fd1d1d)!important;border-top-left-radius:12px!important;border-top-right-radius:12px!important;padding:0 16px 0 16px!important}.instantgram-modal-header h5{color:#fff!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important;margin:revert!important}.instantgram-modal-header h5:nth-child(2){margin-top:-15px!important;margin-bottom:20px!important}.instantgram-modal-body{background:#fff!important;position:relative!important;-webkit-box-flex:1!important;-ms-flex:1 1 auto!important;flex:1 1 auto!important;padding:16px!important}.instantgram-modal-body p{display:block!important;margin:revert!important;margin-block-start:1em!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer{background-color:#fff!important;border-top:1px solid #dbdbdb!important;border-left:0!important;border-right:0!important;border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important;line-height:1.5!important;min-height:48px!important;padding:4px 8px!important;user-select:none!important;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:center!important}.instantgram-modal-footer button{width:100%!important;min-height:39px!important;background-color:transparent!important;border:0!important;outline:0!important;cursor:pointer!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer button.active{color:#0095e2!important}.instantgram-modal-show{opacity:1!important}.instantgram-modal-visible{display:flex!important}#instantgram-bulk-download-indicator{text-align:center!important}',document.head.appendChild(t)}}get element(){return this.modal}createModal(){const e=document.createElement("div");e.classList.add("instantgram-modal-overlay");const t=document.createElement("div");t.classList.add("instantgram-modal"),e.appendChild(t);const a=document.createElement("div");a.classList.add("instantgram-modal-content"),t.appendChild(a);const o=document.createElement("div");o.classList.add("instantgram-modal-header"),this.headingStyle.length>0&&o.setAttribute("style",this.headingStyle),a.appendChild(o),this.heading.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,a=document.createElement("div"),n=document.createDocumentFragment();for(a.innerHTML=e;t=a.firstChild;)n.appendChild(t);o.appendChild(n)}else o.appendChild(e);else{const t=document.createElement("h5");t.innerHTML=e,o.appendChild(t)}}));const n=document.createElement("div");if(n.classList.add("instantgram-modal-body"),this.contentStyle.length>0&&n.setAttribute("style",this.contentStyle),a.appendChild(n),this.imageURL.length>0){const e=document.createElement("div");a.appendChild(e);const t=document.createElement("img");t.setAttribute("height","76px"),t.setAttribute("width","76px"),t.style.margin="auto",t.style.paddingBottom="20px",t.setAttribute("src",this.imageURL),e.appendChild(t)}if(this.content.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,a=document.createElement("div"),o=document.createDocumentFragment();for(a.innerHTML=e;t=a.firstChild;)o.appendChild(t);n.appendChild(o)}else n.appendChild(e);else{const t=document.createElement("p");t.innerText=e,n.appendChild(t)}})),this.buttonList.length>0){const e=document.createElement("div");e.classList.add("instantgram-modal-footer"),a.appendChild(e),this.buttonList.forEach((t=>{const a=document.createElement("button");a.classList.add("instantgram-modal-button"),a.innerText=t.text,t.active&&a.classList.add("active"),a.onclick=t?.callback?t.callback:this.close.bind(this),e.appendChild(a)}))}else a.style.paddingBottom="4px;";return e}async open(){this.modal&&await this.close(),this.modal=this.createModal(),document.body.appendChild(this.modal),this.modal.classList.add("instantgram-modal-visible"),setTimeout((()=>{this.modal.classList.add("instantgram-modal-show")}))}async close(){var e;this.modal&&(this.modal.classList.remove("instantgram-modal-show"),await(e=100,new Promise((function(t){setTimeout(t,e)}))),this.modal.classList.remove("instantgram-modal-visible"),this.modal.parentNode.removeChild(this.modal),this.modal=null)}}async function l(e,t,a,o=[]){return new Promise(((n,i)=>fetch(e+t).then((r=>{if(200!==r.status)throw`${r.status}: ${r.statusText}`;r.text().then((r=>{let d=JSON.parse(r);if(o=o.concat(d.data),console.log(r.includes(a)),d.data.user.edge_owner_to_timeline_media.page_info.has_next_page&&!r.includes(a)){let r=JSON.parse(t);console.log(r),r.after=d.data.user.edge_owner_to_timeline_media.page_info.end_cursor,l(e,String(`${JSON.stringify(r)}`),a,o).then(n).catch(i)}else n(o)})).catch(i)})).catch(i)))}function r(e){if("string"!=typeof e)throw new Error("url must be a string");return e.replace(/\?.*$/,"").split("/").pop().replace(/\.[^.]+$/,"")}const d=async function(e,t,a,o){const n=e[Object.keys(e).find((e=>e.includes("Instance")||e.includes("Fiber")))].return.memoizedProps.fallbackSrc;if(n)return o(n),!0;{let n=null!=a,i=r(e.poster);if(null!==t){let e=null,a="";if(void 0!==t&&t.length>0){let e=[];for(let a=0;a div > div > div > div > span > a")[0].href}else a=t.querySelectorAll("header > div > div > div > div > span > a")[0].href;0;let d=await async function(e){let t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.text()}(a);if(d){let t;d=d.replace(/(\r\n|\n|\r)/gm,"");let a=/profilePage_([0-9]+)/gm;for(;null!==(t=a.exec(d));)t.index===a.lastIndex&&a.lastIndex++,t.forEach((t=>{e=t}))}0;let s=null;if(e){const t=`{"id":${e},"first":100}`;let a=await l("https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables=",t,i);if(a){let e=a[a.length-1];for(let t=0;tnew Promise(((t,a)=>{const o=new Image;o.onload=()=>{const{naturalWidth:e,naturalHeight:a}=o;t({width:e,height:a})},o.onerror=()=>{a("There was some problem with the image.")},o.src=e}));function c(e,t){return(e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)/)||[e,t]).pop()+e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/).pop()}const m={langs:{"en-US":{"helpers.localize_defaultlang":"[instantgram] set language: ${LANG_DEFAULT} \n For more information about available languages please check http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Works only on instagram.com","index@profilepage_downloader_disabled":"Sorry the ProfilePage downloader is currently disabled because instagram changed their system.\n\nMaybe in the future there will be a solution to fix the problem.","index#program@alert_dontFound":'Did you open any Instagram post? Like for example
',"index#program#blob@alert_cannotDownload":"An error has occurred!

Unfortunately we could not download the video try another one.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Download started","index#program#profilePageDownload@stop_collecting_modal_content_1":"You can stop the download by clicking the stop button. If you stop the download, all the images already captured will be downloaded.","index#program#profilePageDownload@stop_collecting_modal_content_2":"If you try to download a lot of pictures at once Instagram may block your IP or your account temporarily.","index#program#profilePageDownload@stop_collecting_modal_btn":"Stop Download","index#program#profilePageDownload@collect_media_modal_title":"Please Wait","index#program#profilePageDownload@collect_media_modal_content":"Now images/videos will being collected","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Collected ${this.resolvedContent} of ${postLinks.size} Posts.","index#program#profilePageDownload@collect_media_modal_btn":"Stop collecting and start the download","index#program#profilePageDownload@collection_complete_modal_title":"Media collection complete","index#program#profilePageDownload@collection_complete_modal_content_1":"Please wait.","index#program#profilePageDownload@collection_complete_modal_content_2":"The download will be now generated.","index#program#profilePageDownload@collection_complete_modal_btn":"Close","index#program#profilePageDownload@cannot_download":"Profile could not be downloaded.","index#program#profilePageDownload@download_progress_at":"Download progress at","index#program#profilePageDownload@compression_progress_at":"Compression progress at","index#program#profilePageDownload@download_failed":"Download failed","modules.modal@isLoading":"Trying to load","modules.update@consoleWarnOutdatedInfo":"[instantgram] is outdated. Please check http://thinkbig-company.github.io/instantgram for available updates.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installed version: ${data.version} | New update: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] is looking for available updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] updated your current version.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"There is a new update available","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Get update"},"es-AR":{"helpers.localize_defaultlang":"[instantgram] establecer idioma: ${LANG_DEFAULT} \n Para más información sobre los idiomas disponibles, consulte http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Sólo funciona en instagram.com","index@profilepage_downloader_disabled":"Lo siento, la descarga de ProfilePage está deshabilitada actualmente porque Instagram cambió su sistema.\n\nTal vez en el futuro haya una solución para solucionar el problema.","index#program@alert_dontFound":'¿Has abierto algún post de Instagram? Como por ejemplo
',"index#program#blob@alert_cannotDownload":"Se ha producido un error.

Desgraciadamente no hemos podido descargar el vídeo, inténtalo con otro.","index#program#profilePageDownload@str_analyzed_from_to":"Había ${data.size} se analizaron los puestos.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Descarga iniciada","index#program#profilePageDownload@stop_collecting_modal_content_1":'Puede detener la descarga haciendo clic en el botón "Detener la descarga". Cuando se detenga la descarga, se descargarán todas las imágenes que ya se hayan capturado.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Si intentas descargar muchas imágenes a la vez, Instagram puede bloquear temporalmente tu IP o tu cuenta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Detener la descarga","index#program#profilePageDownload@collect_media_modal_title":"Espere, por favor","index#program#profilePageDownload@collect_media_modal_content":"Ahora se recogen las imágenes/vídeos","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Un total de ${this.resolvedContent} de ${postLinks.size} Puestos recogidos.","index#program#profilePageDownload@collect_media_modal_btn":"Deja de coleccionar y empieza a descargar","index#program#profilePageDownload@collection_complete_modal_title":"Colección de fotos/vídeos completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, espere.","index#program#profilePageDownload@collection_complete_modal_content_2":"La descarga se genera ahora.","index#program#profilePageDownload@collection_complete_modal_btn":"Cerrar","index#program#profilePageDownload@cannot_download":"No se ha podido descargar el perfil.","modules.modal@isLoading":"Intentando cargar","modules.update@consoleWarnOutdatedInfo":"[instantgram] es obsoleto. Consulte en http://thinkbig-company.github.io/instantgram las actualizaciones disponibles.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Versión instalada: ${data.version} | Nueva actualización: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está buscando actualizaciones disponibles...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] ha actualizado su versión actual.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Hay una nueva actualización disponible","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Obtener información"},"de-DE":{"helpers.localize_defaultlang":"Ausgewählte Sprache: ${LANG_DEFAULT} \n Weitere Informationen zu den unterstützten Sprachen findest du auf http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Funktioniert nur auf instagram.com","index@profilepage_downloader_disabled":"Leider ist der ProfilePage-Downloader derzeit deaktiviert, da Instagram sein System geändert hat.\n\nVielleicht gibt es in Zukunft eine Lösung für dieses Problem.","index#program@alert_dontFound":'Hast du einen Instagram Post geöffnet? Zum Beispiel
',"index#program#blob@alert_cannotDownload":"Es ist ein fehler aufgetreten!

Wir konnten das Video leider nicht Downloaden versuchen Sie ein anderes.","index#program#profilePageDownload@str_analyzed_from_to":"Es wurden ${data.size} Beiträge analysiert.","index#program#profilePageDownload@is_private_modal_title":"Profil ist Privat","index#program#profilePageDownload@is_private_modal_content":"Sorry, aber dieses Profil ist privat und kann nicht heruntergeladen werden.
Versuchen Sie ein anderes Profil.","index#program#profilePageDownload@is_private_modal_btn":"Schließen","index#program#profilePageDownload@stop_collecting_modal_title":"Download gestarted","index#program#profilePageDownload@stop_collecting_modal_content_1":'Sie können den Download stoppen, indem Sie auf die Schaltfläche "Download stoppen" klicken. Wenn Sie das Herunterladen anhalten, werden alle bereits aufgenommenen Bilder heruntergeladen.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Wenn Sie versuchen, viele Bilder auf einmal herunterzuladen, kann Instagram Ihre IP oder Ihr Konto vorübergehend sperren.","index#program#profilePageDownload@stop_collecting_modal_btn":"Download stoppen","index#program#profilePageDownload@collect_media_modal_title":"Bitte warten","index#program#profilePageDownload@collect_media_modal_content":"Bilder/Videos werden jetzt gesammelt","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Insgesamt ${this.resolvedContent} von ${postLinks.size} Beiträgen gesammelt.","index#program#profilePageDownload@collect_media_modal_btn":"Stoppen Sie das Sammeln und starten Sie den Download","index#program#profilePageDownload@collection_complete_modal_title":"Bilder/Video-Sammlung komplett","index#program#profilePageDownload@collection_complete_modal_content_1":"Bitte warten.","index#program#profilePageDownload@collection_complete_modal_content_2":"Der Download wird nun erzeugt.","index#program#profilePageDownload@collection_complete_modal_btn":"Schließen","index#program#profilePageDownload@cannot_download":"Profil konnte nicht runtergeladen werden.","index#program#profilePageDownload@download_progress_at":"Download-Fortschritt bei","index#program#profilePageDownload@compression_progress_at":"Komprimierungs-Fortschritt bei","index#program#profilePageDownload@download_failed":"Download fehlgeschlagen","modules.modal@isLoading":"Wird versucht zu laden","modules.update@consoleWarnOutdatedInfo":"[instantgram] ist veraltet. Bitte besuche die Seite http://thinkbig-company.github.io/instantgram für ein Update.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installierte Version: ${data.version} | Neue Version: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] sucht nach neuen verfügbaren Updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] wurde aktualisiert.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Es ist ein neues Update verfügbar","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Update laden"},"pt-BR":{"helpers.localize_defaultlang":"[instantgram] idioma configurado: ${LANG_DEFAULT} \npara mais informações sobre os idiomas suportados, acesse http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"[instantgram] somente funciona no instagram.com","index@profilepage_downloader_disabled":"Lamentamos que o programa de download ProfilePage esteja atualmente desativado porque o programa mudou seu sistema.\n\nTalvez, no futuro, haja uma solução para resolver o problema.","index#program@alert_dontFound":'ops, você está em algum post do instagram? ex:
',"index#program#blob@alert_cannotDownload":"Ocorreu um erro!

Não pudemos baixar o vídeo infelizmente tentar outro.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Início do download","index#program#profilePageDownload@stop_collecting_modal_content_1":"Você pode interromper o download clicando no botão de parada. Se você interromper o download, todas as imagens já capturadas serão baixadas.","index#program#profilePageDownload@stop_collecting_modal_content_2":"Se você tentar baixar muitas imagens de uma vez, a Instagram poderá bloquear temporariamente seu IP ou sua conta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Parar Download","index#program#profilePageDownload@collect_media_modal_title":"Por favor, aguarde","index#program#profilePageDownload@collect_media_modal_content":"Agora imagens/videos serão coletados","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Recolhido ${este.resolvedContent} de ${postLinks.size} Correios.","index#program#profilePageDownload@collect_media_modal_btn":"Pare de coletar e inicie o download","index#program#profilePageDownload@collection_complete_modal_title":"Coleção de mídia completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, aguarde.","index#program#profilePageDownload@collection_complete_modal_content_2":"O download será agora gerado.","index#program#profilePageDownload@collection_complete_modal_btn":"Fechar","index#program#profilePageDownload@cannot_download":"O perfil não pôde ser baixado.","modules.modal@isLoading":"Tentando carregar","modules.update@consoleWarnOutdatedInfo":"[instantgram] está desatualizado. Acesse http://thinkbig-company.github.io/instantgram para atualizar","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] versão local: ${data.version} | nova versão: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está procurando atualizações...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] informações locais atualizadas","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Há uma nova atualização disponível","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Carga de actualização"}}};let g=navigator.language;-1!==g.indexOf("-")&&(g=g.split("-")[0]),-1!==g.indexOf("_")&&(g=g.split("_")[0]);const p={de:"de-DE",en:"en-US",es:"es-AR",pt:"pt-BR"}[g];function u(e,t=p){try{return m.langs.hasOwnProperty(t)||(t="en-US"),m.langs[t][e]?m.langs[t][e]:""}catch(a){return console.error("[instantgram]LOC error:",a),`ops, an error ocurred in localization system. Enter in https://github.com/ThinkBIG-Company/instantgram/issues/new and open an issue with this code: 'LOC_dont_found_str_neither_default:[${t}->${e}]'\n for more information open the console`}}console.info(u("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",p));const h=u;class f{constructor(){this.modal=new i}getName(){return"MediaScanner"}async execute(t,i){let l=!1;try{let m,g=!1,p={mediaEl:void 0,mediaType:e.UNDEFINED},u=null;if(t.regexProfilePath.test(t.path))return l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,void i(l,null,t);switch(t.regexStoriesURI.test(t.path)&&(new n).execute(t,(function(e,t,a,o){p.mediaEl=t,p.mediaType=a})),null==p.mediaEl&&(g=document.querySelectorAll('[role="dialog"]').length>0,t.regexRootPath.test(t.path)&&(new a).execute(t,(function(e,t,a,o){p.mediaEl=t,p.mediaType=a})),t.regexPostPath.test(t.path)&&(new o).execute(t,g,(function(e,t,a,o){p.mediaEl=t,p.mediaType=a}))),p.mediaType){case e.Image:var r=await async function(e){if(e.getAttribute("srcset")){let t=[];if(e.getAttribute("srcset").split(",").forEach((e=>{t.push(e.trim().split(" "))})),e.hasAttribute("src")&&e.getAttribute("src").length>0){let a={};a[0]=e.getAttribute("src"),a[1]="undefined",t.unshift(a)}let a,o=0,n="";for(let e=0;eo&&(o=a,n=t[e][0])}return n.length>0&&n}return!!(e.hasAttribute("src")&&e.getAttribute("src").length>0)&&e.getAttribute("src")}(p.mediaEl);"string"==typeof r&&(u=r),null!=u&&u.length>10?(l=!0,t.foundImage=!0,t.foundVideo=!1,t.foundByModule=this.getName(),i(l,u,t)):(l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t));break;case e.Video:if(void 0===p.mediaEl.src||0==p.mediaEl.src.length?(p.mediaEl=p.mediaEl.querySelectorAll("source"),u=p.mediaEl[0].src):u=p.mediaEl.src,null!=u&&u.length>10)if(-1!==u.indexOf("blob:")){const e=this;l=!0,t.foundImage=!1,t.foundVideo=!0,t.foundByModule=e.getName(),this.modal.heading=[`
[instantgram] v${t.VERSION}
`],this.modal.content=["

Loading

","

"+h("modules.modal@isLoading")+"

"],this.modal.open(),setTimeout((function(){d(p.mediaEl,undefined,m,(function(a){if(a){e.modal.close();let o="https://scontent.cdninstagram.com"+c(a,"unknown");i(l,o,t)}else e.modal.heading=[`
[instantgram] v${t.VERSION}
`],e.modal.content=[h("index#program#blob@alert_cannotDownload")],e.modal.contentStyle="text-align:center",e.modal.buttonList=[{active:!0,text:"Ok"}],e.modal.open(),i(l,null,t)}))}),500)}else{u=u.replace("amp","&"),l=!0,t.foundImage=!1,t.foundVideo=!0,t.foundByModule=this.getName();let e="https://scontent.cdninstagram.com"+c(u,"unknown");i(l,e,t)}else l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t);break;default:l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t)}}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),i(!1,null,t)}}}const _=function(){const e=/^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i;function t(t,a){let o=(t+"").match(e);return o?(a?o[1]||"==":"")+'"'+(o[2]+".0.0").match(/\d+(?:\.\d+){0,2}/)[0].replace(/(?:^|\.)(\d+)/g,(function(e,t){return Array(9-t.length).join("0")+t}))+(o[3]||"~")+'"':a?"==0":1}return function(e,...a){e=t(e,null);for(var o,n=1;o=arguments[n++];)if(!new Function("return "+e+t(o,1))())return!1;return!0}}();function w(e){console.warn(h("modules.update@consoleWarnOutdatedInfo")),console.warn(h("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}const b=async function(e){(function(e){var t=window.localStorage.getItem("instantgram");if("string"==typeof t){let a=JSON.parse(t);return window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:a.onlineVersion,lastVerification:a.lastVerification,dateExpiration:a.dateExpiration})),_(a.onlineVersion,"> "+a.version)&&w(a),Date.now()>a.dateExpiration}return!0})(e)&&(console.info(h("modules.update@determineIfGetUpdateIsNecessary_contacting")),await fetch("https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={%22id%22:45423705413,%22first%22:100}").then((function(e){return e.json()})).then((function(t){let a=t.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,o=a.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],n=new Date;if(n.setDate(n.getDate()+2),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:o,lastVerification:Date.now(),dateExpiration:n.valueOf()})),console.info(h("modules.update@determineIfGetUpdateIsNecessary_updated")),_(o,"> "+e)){new i({heading:[`
[instantgram] v${e}
`],content:[`
Es ist ein neues Update verfügbar v${o}
`,"
","
","

Changelog

"+a.split("Changelog ")[1]+"
","
",""+h("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"",""],buttonList:[{active:!0,text:"Ok"}]}).open(),w(JSON.parse(window.localStorage.getItem("instantgram")))}else console.info(window.localStorage.getItem("instantgram"))})).catch((e=>{console.error("Error:",e)})))};console.clear();const y={VERSION:"12.0.0",hostname:window.location.hostname,path:window.location.pathname,regexHostname:/^instagram\.com/,regexRootPath:/^\/+$/,regexProfilePath:/^\/([A-Za-z0-9._]{2,3})+\/$/,regexPostPath:/^\/p\//,regexStoriesURI:/stories\/(.*)+/,foundByModule:null,foundVideo:!1,foundImage:!1,foundProfile:!1};"instagram.com"==y.hostname||"www.instagram.com"==y.hostname?(new f).execute(y,(function(e,t,a){y.foundVideo=a.foundVideo,y.foundImage=a.foundImage,y.foundByModule=a.foundByModule,0==e&&a.regexProfilePath.test(a.path)&&(y.foundByModule="CUSTOM",new i({heading:[`
[instantgram] ProfilePage downloader v${y.VERSION}
`],content:[h("index@profilepage_downloader_disabled")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()),e&&null!==t&&window.open(t),null==y.foundByModule&&0==y.foundVideo&&0==y.foundImage&&new i({heading:[`
[instantgram] v${y.VERSION}
`],content:[h("index#program@alert_dontFound")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})):new i({heading:[`
[instantgram] v${y.VERSION}
`],content:[h("index@alert_onlyWorks")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open(),b(y.VERSION)})(); \ No newline at end of file +(()=>{"use strict";var e;function t(e){let t;t=null!==window&&void 0!==window?{top:window.pageYOffset,bottom:window.pageYOffset+window.innerHeight}:document.documentElement;const o=e.getBoundingClientRect(),a=o.y+window.pageYOffset,n=o.y+o.height+window.pageYOffset;if(t.top>n||t.bottomn)return 100;if(at.bottom)return 100;const i=o.height;let l=i;at.bottom&&(l-=n-t.bottom);const r=l/window.innerHeight*100;return Math.round(r)}!function(e){e.Image="IMAGE",e.Video="VIDEO",e.UNDEFINED="UNDEFINED"}(e||(e={}));class o{getName(){return"FeedScanner"}async execute(o,a){try{let n,i,l,r,d=null,s=e.UNDEFINED,c=!1,m="._aagv",g="._9zm0",p="._9zm2";if(null==d){r=document.getElementsByTagName("article");let e=[];for(let o=0;o :nth-child(2) > :first-child ul > li:nth-child(2) img[crossorigin='anonymous']")||r[o].querySelector(":first-child > :nth-child(2) > :first-child ul > li:nth-child(2) video[crossorigin='anonymous']"):r[o].querySelector(":first-child > :nth-child(2) > [role=button] img[crossorigin='anonymous']")||r[o].querySelector(":first-child > :nth-child(2) video[crossorigin='anonymous']"),null!=a&&null!=typeof a.getBoundingClientRect()){let i=t(a);e.push({i1:o,mediaEl:a,elemVisiblePercentage:i,isCarousel:n})}else e.push({i1:o,mediaEl:a,elemVisiblePercentage:0,isCarousel:n})}let o=e.reduce(((e,t)=>e.elemVisiblePercentage>t.elemVisiblePercentage?e:t));l=r[o.i1],n=e[o.i1]}if(n.isCarousel){let t=Array.from(l.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=t&&t.length>0){let a=Array.from(l.querySelectorAll(":first-child > div:nth-child(2) > div > div:nth-child(2) > div")).filter((e=>e.classList.length<=2));for(let e=0;e img[src]`)||null!==l.querySelector(`${m} > img[srcset]`);t?(s=e.Video,d=l.querySelector("video")):o&&(s=e.Image,d=null!==l.querySelector(`${m} > img[srcset]`)?l.querySelector(`${m} > img[srcset]`):l.querySelector(`${m} > img[src]`))}a(false,d,s,o)}catch(e){console.error(this.getName()+"()",`[instantgram] ${o.VERSION}`,e),a(!1,null,o)}}}class a{getName(){return"PostScanner"}async execute(t,o,a){try{let n,i,l=o,r=!1,d=null,s=e.UNDEFINED,c=!1,m=document.querySelector("main"),g="._aagv",p="._9zm0",h="._9zm2";if(l?(i=document.querySelectorAll('[role="dialog"]')[1],r=0!==i.querySelectorAll(p).length||0!==i.querySelectorAll(h).length):(m=document.querySelector("section main > div > :first-child"),i=m.querySelector("article"),r=0!==i.querySelectorAll(p).length||0!==i.querySelectorAll(h).length),r){let o=Array.from(i.querySelectorAll("div > :first-child > :first-child > :first-child > ul li")).filter((e=>null!=e.firstChild&&e.classList.length>0));if(null!=o&&o.length>0){let a=Array.from(i.querySelectorAll("article > :first-child > :first-child > :first-child > div:nth-child(2) > div")).filter((e=>e.classList.length<=2));for(let e=0;e img[src]`)||null!==i.querySelector(`${g} > img[srcset]`);t?(s=e.Video,d=i.querySelector("video")):o&&(s=e.Image,d=null!==i.querySelector(`${g} > img[srcset]`)?i.querySelector(`${g} > img[srcset]`):i.querySelector(`${g} > img[src]`))}a(false,d,s,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),a(!1,null,t)}}}class n{getName(){return"StoryScanner"}async execute(t,o){try{let a=null,n=e.UNDEFINED,i=document.querySelector("main");i=document.querySelector("body > div");let l=i.querySelectorAll("section > div > div > div");for(let t=0;t=1&&l[t].classList.length>1){let o=null!==l[t].querySelector("video"),i=null!==l[t].querySelector("div > div img[src]")||null!==l[t].querySelector("div > div img[srcset]");0,o&&i?(n=e.Video,a=l[t].querySelector("video")):i&&(n=e.Image,null!==l[t].querySelectorAll("img")[0]&&(a=l[t].querySelectorAll("img")[0]));break}}o(false,a,n,t)}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),o(!1,null,t)}}}class i{constructor(e){if(this.modal=null,this.imageURL=e?.imageURL||"",this.heading=e?.heading||[""],this.headingStyle=e?.headingStyle||"",this.content=e?.content||[""],this.contentStyle=e?.contentStyle||"",this.buttonList=e?.buttonList||[],null==document.getElementById("instantgram-modal")){var t=document.createElement("style");t.id="instantgram-modal",t.innerHTML='.instantgram-modal-overlay{display:none!important;opacity:0!important;transition:all ease .1s!important;position:fixed!important;top:0!important;left:0!important;right:0!important;bottom:0!important;z-index:1000!important;background:rgba(0,0,0,.65)!important;justify-content:center!important;align-items:center!important}.instantgram-modal{transition:width ease-in-out .1s!important;display:inline-block!important;width:400px!important;padding:1.6px!important;z-index:1001!important}.instantgram-modal select{margin-left:.8px!important;border:solid 1px #dbdbdb!important;border-radius:3px!important;color:#262626!important;outline:0!important;padding:3px!important;text-align:center!important}@media (min-width:736px){.instantgram-modal{width:500px!important}}.instantgram-modal-content{position:relative;display:flex;flex-direction:column;width:100%!important;pointer-events:auto!important;background-clip:padding-box!important;outline:0!important}.instantgram-modal-header{color:#fff!important;background-color:#fd1d1d!important;background-image:linear-gradient(45deg,#405de6,#5851db,#833ab4,#c13584,#e1306c,#fd1d1d)!important;border-top-left-radius:12px!important;border-top-right-radius:12px!important;padding:0 16px 0 16px!important}.instantgram-modal-header h5{color:#fff!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important;margin:revert!important}.instantgram-modal-header h5:nth-child(2){margin-top:-15px!important;margin-bottom:20px!important}.instantgram-modal-body{background:#fff!important;position:relative!important;-webkit-box-flex:1!important;-ms-flex:1 1 auto!important;flex:1 1 auto!important;padding:16px!important}.instantgram-modal-body p{display:block!important;margin:revert!important;margin-block-start:1em!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer{background-color:#fff!important;border-top:1px solid #dbdbdb!important;border-left:0!important;border-right:0!important;border-bottom-left-radius:12px!important;border-bottom-right-radius:12px!important;line-height:1.5!important;min-height:48px!important;padding:4px 8px!important;user-select:none!important;display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-align:center!important;-ms-flex-align:center!important;align-items:center!important;-webkit-box-pack:end!important;-ms-flex-pack:end!important;justify-content:center!important}.instantgram-modal-footer button{width:100%!important;min-height:39px!important;background-color:transparent!important;border:0!important;outline:0!important;cursor:pointer!important;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif!important;font-size:16px!important}.instantgram-modal-footer button.active{color:#0095e2!important}.instantgram-modal-show{opacity:1!important}.instantgram-modal-visible{display:flex!important}#instantgram-bulk-download-indicator{text-align:center!important}',document.head.appendChild(t)}}get element(){return this.modal}createModal(){const e=document.createElement("div");e.classList.add("instantgram-modal-overlay");const t=document.createElement("div");t.classList.add("instantgram-modal"),e.appendChild(t);const o=document.createElement("div");o.classList.add("instantgram-modal-content"),t.appendChild(o);const a=document.createElement("div");a.classList.add("instantgram-modal-header"),this.headingStyle.length>0&&a.setAttribute("style",this.headingStyle),o.appendChild(a),this.heading.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,o=document.createElement("div"),n=document.createDocumentFragment();for(o.innerHTML=e;t=o.firstChild;)n.appendChild(t);a.appendChild(n)}else a.appendChild(e);else{const t=document.createElement("h5");t.innerHTML=e,a.appendChild(t)}}));const n=document.createElement("div");if(n.classList.add("instantgram-modal-body"),this.contentStyle.length>0&&n.setAttribute("style",this.contentStyle),o.appendChild(n),this.imageURL.length>0){const e=document.createElement("div");o.appendChild(e);const t=document.createElement("img");t.setAttribute("height","76px"),t.setAttribute("width","76px"),t.style.margin="auto",t.style.paddingBottom="20px",t.setAttribute("src",this.imageURL),e.appendChild(t)}if(this.content.forEach((e=>{if("string"!=typeof e||/<\/?[a-z][\s\S]*>/i.test(e))if(/<\/?[a-z][\s\S]*>/i.test(e)){let t,o=document.createElement("div"),a=document.createDocumentFragment();for(o.innerHTML=e;t=o.firstChild;)a.appendChild(t);n.appendChild(a)}else n.appendChild(e);else{const t=document.createElement("p");t.innerText=e,n.appendChild(t)}})),this.buttonList.length>0){const e=document.createElement("div");e.classList.add("instantgram-modal-footer"),o.appendChild(e),this.buttonList.forEach((t=>{const o=document.createElement("button");o.classList.add("instantgram-modal-button"),o.innerText=t.text,t.active&&o.classList.add("active"),o.onclick=t?.callback?t.callback:this.close.bind(this),e.appendChild(o)}))}else o.style.paddingBottom="4px;";return e}async open(){this.modal&&await this.close(),this.modal=this.createModal(),document.body.appendChild(this.modal),this.modal.classList.add("instantgram-modal-visible"),setTimeout((()=>{this.modal.classList.add("instantgram-modal-show")}))}async close(){var e;this.modal&&(this.modal.classList.remove("instantgram-modal-show"),await(e=100,new Promise((function(t){setTimeout(t,e)}))),this.modal.classList.remove("instantgram-modal-visible"),this.modal.parentNode.removeChild(this.modal),this.modal=null)}}async function l(e,t,o,a=[]){return new Promise(((n,i)=>fetch(e+t).then((r=>{if(200!==r.status)throw`${r.status}: ${r.statusText}`;r.text().then((r=>{let d=JSON.parse(r);if(a=a.concat(d.data),console.log(r.includes(o)),d.data.user.edge_owner_to_timeline_media.page_info.has_next_page&&!r.includes(o)){let r=JSON.parse(t);console.log(r),r.after=d.data.user.edge_owner_to_timeline_media.page_info.end_cursor,l(e,String(`${JSON.stringify(r)}`),o,a).then(n).catch(i)}else n(a)})).catch(i)})).catch(i)))}function r(e){if("string"!=typeof e)throw new Error("url must be a string");return e.replace(/\?.*$/,"").split("/").pop().replace(/\.[^.]+$/,"")}const d=async function(e,t,o,a){const n=e[Object.keys(e).find((e=>e.includes("Instance")||e.includes("Fiber")))].return.memoizedProps.fallbackSrc;if(n)return a(n),!0;{let n=null!=o,i=r(e.poster);if(null!==t){let e=null,o="";if(void 0!==t&&t.length>0){let e=[];for(let o=0;o div > div > div > div > span > a")[0].href}else o=t.querySelectorAll("header > div > div > div > div > span > a")[0].href;0;let d=await async function(e){let t=await fetch(e);if(!t.ok)throw new Error(`HTTP error! status: ${t.status}`);return await t.text()}(o);if(d){let t;d=d.replace(/(\r\n|\n|\r)/gm,"");let o=/profilePage_([0-9]+)/gm;for(;null!==(t=o.exec(d));)t.index===o.lastIndex&&o.lastIndex++,t.forEach((t=>{e=t}))}0;let s=null;if(e){const t=`{"id":${e},"first":100}`;let o=await l("https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables=",t,i);if(o){let e=o[o.length-1];for(let t=0;tnew Promise(((t,o)=>{const a=new Image;a.onload=()=>{const{naturalWidth:e,naturalHeight:o}=a;t({width:e,height:o})},a.onerror=()=>{o("There was some problem with the image.")},a.src=e}));function c(e,t){return(e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)/)||[e,t]).pop()+e.match(/(?:\w+:)?\/\/[^\/]+([^?#]+)([^\?]+)(\?.*)?/).pop()}const m={langs:{"en-US":{"helpers.localize_defaultlang":"[instantgram] set language: ${LANG_DEFAULT} \n For more information about available languages please check http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Works only on instagram.com","index@profilepage_downloader_disabled":"Sorry the ProfilePage downloader is currently disabled because instagram changed their system.\n\nMaybe in the future there will be a solution to fix the problem.","index#program@alert_dontFound":'Did you open any Instagram post? Like for example
',"index#program#blob@alert_cannotDownload":"An error has occurred!

Unfortunately we could not download the video try another one.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Download started","index#program#profilePageDownload@stop_collecting_modal_content_1":"You can stop the download by clicking the stop button. If you stop the download, all the images already captured will be downloaded.","index#program#profilePageDownload@stop_collecting_modal_content_2":"If you try to download a lot of pictures at once Instagram may block your IP or your account temporarily.","index#program#profilePageDownload@stop_collecting_modal_btn":"Stop Download","index#program#profilePageDownload@collect_media_modal_title":"Please Wait","index#program#profilePageDownload@collect_media_modal_content":"Now images/videos will being collected","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Collected ${this.resolvedContent} of ${postLinks.size} Posts.","index#program#profilePageDownload@collect_media_modal_btn":"Stop collecting and start the download","index#program#profilePageDownload@collection_complete_modal_title":"Media collection complete","index#program#profilePageDownload@collection_complete_modal_content_1":"Please wait.","index#program#profilePageDownload@collection_complete_modal_content_2":"The download will be now generated.","index#program#profilePageDownload@collection_complete_modal_btn":"Close","index#program#profilePageDownload@cannot_download":"Profile could not be downloaded.","index#program#profilePageDownload@download_progress_at":"Download progress at","index#program#profilePageDownload@compression_progress_at":"Compression progress at","index#program#profilePageDownload@download_failed":"Download failed","modules.modal@isLoading":"Trying to load","modules.update@consoleWarnOutdatedInfo":"[instantgram] is outdated. Please check http://thinkbig-company.github.io/instantgram for available updates.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installed version: ${data.version} | New update: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] is looking for available updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] updated your current version.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"There is a new update available","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Get update"},"es-AR":{"helpers.localize_defaultlang":"[instantgram] establecer idioma: ${LANG_DEFAULT} \n Para más información sobre los idiomas disponibles, consulte http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Sólo funciona en instagram.com","index@profilepage_downloader_disabled":"Lo siento, la descarga de ProfilePage está deshabilitada actualmente porque Instagram cambió su sistema.\n\nTal vez en el futuro haya una solución para solucionar el problema.","index#program@alert_dontFound":'¿Has abierto algún post de Instagram? Como por ejemplo
',"index#program#blob@alert_cannotDownload":"Se ha producido un error.

Desgraciadamente no hemos podido descargar el vídeo, inténtalo con otro.","index#program#profilePageDownload@str_analyzed_from_to":"Había ${data.size} se analizaron los puestos.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Descarga iniciada","index#program#profilePageDownload@stop_collecting_modal_content_1":'Puede detener la descarga haciendo clic en el botón "Detener la descarga". Cuando se detenga la descarga, se descargarán todas las imágenes que ya se hayan capturado.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Si intentas descargar muchas imágenes a la vez, Instagram puede bloquear temporalmente tu IP o tu cuenta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Detener la descarga","index#program#profilePageDownload@collect_media_modal_title":"Espere, por favor","index#program#profilePageDownload@collect_media_modal_content":"Ahora se recogen las imágenes/vídeos","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Un total de ${this.resolvedContent} de ${postLinks.size} Puestos recogidos.","index#program#profilePageDownload@collect_media_modal_btn":"Deja de coleccionar y empieza a descargar","index#program#profilePageDownload@collection_complete_modal_title":"Colección de fotos/vídeos completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, espere.","index#program#profilePageDownload@collection_complete_modal_content_2":"La descarga se genera ahora.","index#program#profilePageDownload@collection_complete_modal_btn":"Cerrar","index#program#profilePageDownload@cannot_download":"No se ha podido descargar el perfil.","modules.modal@isLoading":"Intentando cargar","modules.update@consoleWarnOutdatedInfo":"[instantgram] es obsoleto. Consulte en http://thinkbig-company.github.io/instantgram las actualizaciones disponibles.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Versión instalada: ${data.version} | Nueva actualización: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está buscando actualizaciones disponibles...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] ha actualizado su versión actual.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Hay una nueva actualización disponible","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Obtener información"},"de-DE":{"helpers.localize_defaultlang":"Ausgewählte Sprache: ${LANG_DEFAULT} \n Weitere Informationen zu den unterstützten Sprachen findest du auf http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"Funktioniert nur auf instagram.com","index@profilepage_downloader_disabled":"Leider ist der ProfilePage-Downloader derzeit deaktiviert, da Instagram sein System geändert hat.\n\nVielleicht gibt es in Zukunft eine Lösung für dieses Problem.","index#program@alert_dontFound":'Hast du einen Instagram Post geöffnet? Zum Beispiel
',"index#program#blob@alert_cannotDownload":"Es ist ein fehler aufgetreten!

Wir konnten das Video leider nicht Downloaden versuchen Sie ein anderes.","index#program#profilePageDownload@str_analyzed_from_to":"Es wurden ${data.size} Beiträge analysiert.","index#program#profilePageDownload@is_private_modal_title":"Profil ist Privat","index#program#profilePageDownload@is_private_modal_content":"Sorry, aber dieses Profil ist privat und kann nicht heruntergeladen werden.
Versuchen Sie ein anderes Profil.","index#program#profilePageDownload@is_private_modal_btn":"Schließen","index#program#profilePageDownload@stop_collecting_modal_title":"Download gestarted","index#program#profilePageDownload@stop_collecting_modal_content_1":'Sie können den Download stoppen, indem Sie auf die Schaltfläche "Download stoppen" klicken. Wenn Sie das Herunterladen anhalten, werden alle bereits aufgenommenen Bilder heruntergeladen.',"index#program#profilePageDownload@stop_collecting_modal_content_2":"Wenn Sie versuchen, viele Bilder auf einmal herunterzuladen, kann Instagram Ihre IP oder Ihr Konto vorübergehend sperren.","index#program#profilePageDownload@stop_collecting_modal_btn":"Download stoppen","index#program#profilePageDownload@collect_media_modal_title":"Bitte warten","index#program#profilePageDownload@collect_media_modal_content":"Bilder/Videos werden jetzt gesammelt","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Insgesamt ${this.resolvedContent} von ${postLinks.size} Beiträgen gesammelt.","index#program#profilePageDownload@collect_media_modal_btn":"Stoppen Sie das Sammeln und starten Sie den Download","index#program#profilePageDownload@collection_complete_modal_title":"Bilder/Video-Sammlung komplett","index#program#profilePageDownload@collection_complete_modal_content_1":"Bitte warten.","index#program#profilePageDownload@collection_complete_modal_content_2":"Der Download wird nun erzeugt.","index#program#profilePageDownload@collection_complete_modal_btn":"Schließen","index#program#profilePageDownload@cannot_download":"Profil konnte nicht runtergeladen werden.","index#program#profilePageDownload@download_progress_at":"Download-Fortschritt bei","index#program#profilePageDownload@compression_progress_at":"Komprimierungs-Fortschritt bei","index#program#profilePageDownload@download_failed":"Download fehlgeschlagen","modules.modal@isLoading":"Wird versucht zu laden","modules.update@consoleWarnOutdatedInfo":"[instantgram] ist veraltet. Bitte besuche die Seite http://thinkbig-company.github.io/instantgram für ein Update.","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] Installierte Version: ${data.version} | Neue Version: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] sucht nach neuen verfügbaren Updates...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] wurde aktualisiert.","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Es ist ein neues Update verfügbar","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Update laden"},"pt-BR":{"helpers.localize_defaultlang":"[instantgram] idioma configurado: ${LANG_DEFAULT} \npara mais informações sobre os idiomas suportados, acesse http://thinkbig-company.github.io/instantgram","index@alert_onlyWorks":"[instantgram] somente funciona no instagram.com","index@profilepage_downloader_disabled":"Lamentamos que o programa de download ProfilePage esteja atualmente desativado porque o programa mudou seu sistema.\n\nTalvez, no futuro, haja uma solução para resolver o problema.","index#program@alert_dontFound":'ops, você está em algum post do instagram? ex:
',"index#program#blob@alert_cannotDownload":"Ocorreu um erro!

Não pudemos baixar o vídeo infelizmente tentar outro.","index#program#profilePageDownload@str_analyzed_from_to":"Analyzed ${data.size} Posts.","index#program#profilePageDownload@is_private_modal_title":"Profile private","index#program#profilePageDownload@is_private_modal_content":"Sorry but this profile is private and can not be downloaded.
Try another profile.","index#program#profilePageDownload@is_private_modal_btn":"Close","index#program#profilePageDownload@stop_collecting_modal_title":"Início do download","index#program#profilePageDownload@stop_collecting_modal_content_1":"Você pode interromper o download clicando no botão de parada. Se você interromper o download, todas as imagens já capturadas serão baixadas.","index#program#profilePageDownload@stop_collecting_modal_content_2":"Se você tentar baixar muitas imagens de uma vez, a Instagram poderá bloquear temporariamente seu IP ou sua conta.","index#program#profilePageDownload@stop_collecting_modal_btn":"Parar Download","index#program#profilePageDownload@collect_media_modal_title":"Por favor, aguarde","index#program#profilePageDownload@collect_media_modal_content":"Agora imagens/videos serão coletados","index#program#profilePageDownload@collect_media_modal_content_download_indicator":"Recolhido ${este.resolvedContent} de ${postLinks.size} Correios.","index#program#profilePageDownload@collect_media_modal_btn":"Pare de coletar e inicie o download","index#program#profilePageDownload@collection_complete_modal_title":"Coleção de mídia completa","index#program#profilePageDownload@collection_complete_modal_content_1":"Por favor, aguarde.","index#program#profilePageDownload@collection_complete_modal_content_2":"O download será agora gerado.","index#program#profilePageDownload@collection_complete_modal_btn":"Fechar","index#program#profilePageDownload@cannot_download":"O perfil não pôde ser baixado.","modules.modal@isLoading":"Tentando carregar","modules.update@consoleWarnOutdatedInfo":"[instantgram] está desatualizado. Acesse http://thinkbig-company.github.io/instantgram para atualizar","modules.update@consoleWarnOutdatedInfoVersions":"[instantgram] versão local: ${data.version} | nova versão: ${data.onlineVersion}","modules.update@determineIfGetUpdateIsNecessary_contacting":"[instantgram] está procurando atualizações...","modules.update@determineIfGetUpdateIsNecessary_updated":"[instantgram] informações locais atualizadas","modules.update@determineIfGetUpdateIsNecessary_@update_available":"Há uma nova atualização disponível","modules.update@determineIfGetUpdateIsNecessary_@load_update":"Carga de actualização"}}};let g=navigator.language;-1!==g.indexOf("-")&&(g=g.split("-")[0]),-1!==g.indexOf("_")&&(g=g.split("_")[0]);const p={de:"de-DE",en:"en-US",es:"es-AR",pt:"pt-BR"}[g];function h(e,t=p){try{return m.langs.hasOwnProperty(t)||(t="en-US"),m.langs[t][e]?m.langs[t][e]:""}catch(o){return console.error("[instantgram]LOC error:",o),`ops, an error ocurred in localization system. Enter in https://github.com/ThinkBIG-Company/instantgram/issues/new and open an issue with this code: 'LOC_dont_found_str_neither_default:[${t}->${e}]'\n for more information open the console`}}console.info(h("helpers.localize_defaultlang").replace("${LANG_DEFAULT}",p));const u=h;class f{constructor(){this.modal=new i}getName(){return"MediaScanner"}async execute(t,i){let l=!1;try{let m,g=!1,p={mediaEl:void 0,mediaType:e.UNDEFINED},h=null;if(t.regexProfilePath.test(t.path))return l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,void i(l,null,t);switch(t.regexStoriesURI.test(t.path)&&(new n).execute(t,(function(e,t,o,a){p.mediaEl=t,p.mediaType=o})),null==p.mediaEl&&(g=document.querySelectorAll('[role="dialog"]').length>0,t.regexRootPath.test(t.path)&&(new o).execute(t,(function(e,t,o,a){p.mediaEl=t,p.mediaType=o})),t.regexPostPath.test(t.path)&&(new a).execute(t,g,(function(e,t,o,a){p.mediaEl=t,p.mediaType=o}))),p.mediaType){case e.Image:var r=await async function(e){if(e.getAttribute("srcset")){let t=[];if(e.getAttribute("srcset").split(",").forEach((e=>{t.push(e.trim().split(" "))})),e.hasAttribute("src")&&e.getAttribute("src").length>0){let o={};o[0]=e.getAttribute("src"),o[1]="undefined",t.unshift(o)}let o,a=0,n="";for(let e=0;ea&&(a=o,n=t[e][0])}return n.length>0&&n}return!!(e.hasAttribute("src")&&e.getAttribute("src").length>0)&&e.getAttribute("src")}(p.mediaEl);"string"==typeof r&&(h=r),null!=h&&h.length>10?(l=!0,t.foundImage=!0,t.foundVideo=!1,t.foundByModule=this.getName(),i(l,h,t)):(l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t));break;case e.Video:if(void 0===p.mediaEl.src||0==p.mediaEl.src.length?(p.mediaEl=p.mediaEl.querySelectorAll("source"),h=p.mediaEl[0].src):h=p.mediaEl.src,null!=h&&h.length>10)if(-1!==h.indexOf("blob:")){const e=this;l=!0,t.foundImage=!1,t.foundVideo=!0,t.foundByModule=e.getName(),this.modal.heading=[`
[instantgram] v${t.VERSION}
`],this.modal.content=["

Loading

","

"+u("modules.modal@isLoading")+"

"],this.modal.open(),setTimeout((function(){d(p.mediaEl,undefined,m,(function(o){if(o){e.modal.close();let a="https://scontent.cdninstagram.com"+c(o,"unknown");i(l,a,t)}else e.modal.heading=[`
[instantgram] v${t.VERSION}
`],e.modal.content=[u("index#program#blob@alert_cannotDownload")],e.modal.contentStyle="text-align:center",e.modal.buttonList=[{active:!0,text:"Ok"}],e.modal.open(),i(l,null,t)}))}),500)}else{h=h.replace("amp","&"),l=!0,t.foundImage=!1,t.foundVideo=!0,t.foundByModule=this.getName();let e="https://scontent.cdninstagram.com"+c(h,"unknown");i(l,e,t)}else l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t);break;default:l=!1,t.foundImage=!1,t.foundVideo=!1,t.foundByModule=void 0,i(l,null,t)}}catch(e){console.error(this.getName()+"()",`[instantgram] ${t.VERSION}`,e),i(!1,null,t)}}}const _=function(){const e=/^(<|>|[=!<>]=)?\s*(\d+(?:\.\d+){0,2})([a-z][a-z0-9\-]*)?$/i;function t(t,o){let a=(t+"").match(e);return a?(o?a[1]||"==":"")+'"'+(a[2]+".0.0").match(/\d+(?:\.\d+){0,2}/)[0].replace(/(?:^|\.)(\d+)/g,(function(e,t){return Array(9-t.length).join("0")+t}))+(a[3]||"~")+'"':o?"==0":1}return function(e,...o){e=t(e,null);for(var a,n=1;a=arguments[n++];)if(!new Function("return "+e+t(a,1))())return!1;return!0}}();function w(e){console.warn(u("modules.update@consoleWarnOutdatedInfo")),console.warn(u("modules.update@consoleWarnOutdatedInfoVersions").replace("${data.version}",e.version).replace("${data.onlineVersion}",e.onlineVersion))}const b=async function(e){(function(e){var t=window.localStorage.getItem("instantgram");if("string"==typeof t){let o=JSON.parse(t);return window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:o.onlineVersion,lastVerification:o.lastVerification,dateExpiration:o.dateExpiration})),_(o.onlineVersion,"> "+o.version)&&w(o),Date.now()>o.dateExpiration}return!0})(e)&&(console.info(u("modules.update@determineIfGetUpdateIsNecessary_contacting")),await fetch("https://www.instagram.com/graphql/query/?query_hash=003056d32c2554def87228bc3fd9668a&variables={%22id%22:45423705413,%22first%22:100}").then((function(e){return e.json()})).then((function(t){let o=t.data.user.edge_owner_to_timeline_media.edges[0].node.edge_media_to_caption.edges[0].node.text,a=o.match(/(\*|\d+(\.\d+){0,2}(\.\*)?)+/gm)[0],n=new Date;if(n.setDate(n.getDate()+2),window.localStorage.setItem("instantgram",JSON.stringify({version:e,onlineVersion:a,lastVerification:Date.now(),dateExpiration:n.valueOf()})),console.info(u("modules.update@determineIfGetUpdateIsNecessary_updated")),_(a,"> "+e)){new i({heading:[`
[instantgram] v${e}
`],content:[`
Es ist ein neues Update verfügbar v${a}
`,"
","
","

Changelog

"+o.split("Changelog ")[1]+"
","
",""+u("modules.update@determineIfGetUpdateIsNecessary_@load_update")+"",""],buttonList:[{active:!0,text:"Ok"}]}).open(),w(JSON.parse(window.localStorage.getItem("instantgram")))}else console.info(window.localStorage.getItem("instantgram"))})).catch((e=>{console.error("Error:",e)})))};var y=function(e,t,o){if(o||2===arguments.length)for(var a,n=0,i=t.length;n[instantgram] ProfilePage downloader v${A.VERSION}`],content:[u("index@profilepage_downloader_disabled")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()),e&&null!==t&&window.open(t),null==A.foundByModule&&0==A.foundVideo&&0==A.foundImage&&new i({heading:[`
[instantgram] v${A.VERSION}
`],content:[u("index#program@alert_dontFound")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open()})):new i({heading:[`
[instantgram] v${A.VERSION}
`],content:[u("index@alert_onlyWorks")],contentStyle:"text-align:center",buttonList:[{active:!0,text:"Ok"}]}).open(),b(A.VERSION)})(); \ No newline at end of file diff --git a/index.html b/index.html index 58787e2..8c84dbe 100644 --- a/index.html +++ b/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 12.0.0]
+ [instantgram 12.1.0]
drag this button to the bookmark bar of your browser. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/de-de/index.html b/lang/de-de/index.html index c772d5b..39265d0 100644 --- a/lang/de-de/index.html +++ b/lang/de-de/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ Ein Bookmarklet, um Bilder auf Instagram herunterzuladen

- [instantgram 12.0.0]
+ [instantgram 12.1.0]
Ziehe diesen Button in die Favoritenleiste deines Browsers. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/en-us/index.html b/lang/en-us/index.html index 58787e2..8c84dbe 100644 --- a/lang/en-us/index.html +++ b/lang/en-us/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ A bookmarklet for downloading images from Instagram.

- [instantgram 12.0.0]
+ [instantgram 12.1.0]
drag this button to the bookmark bar of your browser. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/es-ar/index.html b/lang/es-ar/index.html index 08e5060..6f233ac 100644 --- a/lang/es-ar/index.html +++ b/lang/es-ar/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ Un bookmarklet para descargar imágenes de Instagram.

- [instantgram 12.0.0]
+ [instantgram 12.1.0]
Arrastre este botón a la barra de favoritos de su navegador. @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/lang/pt-br/index.html b/lang/pt-br/index.html index fced317..425408e 100644 --- a/lang/pt-br/index.html +++ b/lang/pt-br/index.html @@ -94,7 +94,7 @@

Instantgram

☁️ Um bookmarklet para download de fotos do Instagram

- [instantgram 12.0.0]
+ [instantgram 12.1.0]
arraste o botão acima para a barra de favoritos do navegador @@ -106,7 +106,7 @@

[instantgram]

- version + version badge

diff --git a/package.json b/package.json index 4b43c52..d4f914d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "instantgram", - "version": "12.0.0", + "version": "12.1.0", "description": "A bookmarklet for download photos in Instagram", "author": "Matheus Falcão and from 4.0.0 Sascha Heim", "homepage": "https://thinkbig-company.github.io/instantgram/", @@ -24,16 +24,15 @@ "build": "npm run build:webpack && npm run build:release" }, "devDependencies": { + "@babel/core": "^7.1.6", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", - "babel-core": "^6.26.3", - "babel-loader": "^7.1.5", + "babel-loader": "^8.0.4", "babel-polyfill": "^6.26.0", "babel-preset-env": "^1.7.0", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-0": "^6.24.1", "bookmarkletify": "github:ThinkBIG-Company/bookmarkletify", - "closure-webpack-plugin": "^2.5.0", "compression-webpack-plugin": "^8.0.0", "concurrently": "^6.5.1", "css-loader": "^5.2.7", @@ -61,6 +60,7 @@ }, "dependencies": { "client-zip": "^2.2.2", - "gulp": "^4.0.2" + "detect-browser": "^5.3.0", + "gulp": "^3.9.1" } } diff --git a/src/App.ts b/src/App.ts index fcaa21f..2652e4c 100644 --- a/src/App.ts +++ b/src/App.ts @@ -1,6 +1,8 @@ export type Program = { VERSION: string + browser: any + hostname: string path: string diff --git a/src/_langs/partials/button.html b/src/_langs/partials/button.html index 6fbbda8..7bac636 100644 --- a/src/_langs/partials/button.html +++ b/src/_langs/partials/button.html @@ -1 +1 @@ -[instantgram 12.0.0] \ No newline at end of file +[instantgram 12.1.0] \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 24d9cad..5234351 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,11 +5,17 @@ import { Modal } from './components/Modal' import Update from './modules/Update' import localize from './helpers/localize' +import { detect } from "detect-browser" +// Init browser detection +const browser = detect() + console.clear() const program: Program = { VERSION: process.env.VERSION as string, + browser: browser, + hostname: window.location.hostname, path: window.location.pathname, @@ -27,6 +33,12 @@ const program: Program = { if (process.env.DEV) { console.info(['Developer Mode Caution!', program]) + + if (program.browser) { + console.info(['Browser Name', program.browser.name]) + console.info(['Browser Version', program.browser.version]) + console.info(['Browser OS', program.browser.os]) + } } /* =============================== diff --git a/src/modules/FeedScanner.ts b/src/modules/FeedScanner.ts index 94fdaaa..1d6c564 100644 --- a/src/modules/FeedScanner.ts +++ b/src/modules/FeedScanner.ts @@ -25,9 +25,6 @@ export class FeedScanner implements Module { let selectedCarouselMediaSlideIndex: number let isLastMedia: boolean = false - // Container - let $container = document.querySelector("main") - // Selected Article let $article: Element @@ -37,21 +34,17 @@ export class FeedScanner implements Module { // Media selector let mediaSelector: string = "._aagv" - let carouselLeftButtonSelector: string = "._aahh" - let carouselRightButtonSelector: string = "._aahi" + let carouselLeftButtonSelector: string = "._9zm0" + let carouselRightButtonSelector: string = "._9zm2" + // Scanner begins if (mediaEl == null) { - $container = document.querySelector("main section > div:first-child > div:last-child > div:first-child > div:first-child") - //$articles = $container.querySelectorAll("article") $articles = document.getElementsByTagName("article") let mediaElInfos: any[] = [] for (let i1 = 0; i1 < $articles.length; i1++) { let isCarousel = $articles[i1].querySelector(carouselLeftButtonSelector) !== null || $articles[i1].querySelector(carouselRightButtonSelector) !== null - //console.log([`article ${i1 + 1}`, $articles[i1]]) - //console.log([`isCarousel ${i1 + 1}`, isCarousel]) - let mediaEl: any if (isCarousel) { mediaEl = $articles[i1].querySelector(":first-child > :nth-child(2) > :first-child ul > li:nth-child(2) img[crossorigin='anonymous']") @@ -86,11 +79,15 @@ export class FeedScanner implements Module { ).filter((el: any) => el.firstChild != null && el.classList.length > 0) if (carouselMediaSlideElements != null && carouselMediaSlideElements.length > 0) { - let carouselControlsArray: any = ($article as HTMLElement).querySelectorAll(":first-child > div:nth-child(2) > div > div:nth-child(2) > div") + let carouselControlsArray: any = Array.from( + ($article as HTMLElement).querySelectorAll( + ":first-child > div:nth-child(2) > div > div:nth-child(2) > div" + ) + ).filter((el: any) => el.classList.length <= 2) // Detect current image index of carousel for (let i = 0; i < carouselControlsArray.length; i++) { - if (carouselControlsArray[i].classList.length >= 2) { + if (carouselControlsArray[i].classList.length == 2) { selectedCarouselMediaSlideIndex = i } @@ -140,60 +137,157 @@ export class FeedScanner implements Module { } break case 5: - if (S == 4) { - mediaEl = M[Math.ceil(M.length / 2)] - } else if (S == 3) { - mediaEl = M[Math.ceil(M.length / 2)] + if (program.browser.name == "firefox") { + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = M[Math.ceil(M.length / 2) - 1] + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 6: - if (S == 4) { - mediaEl = M[Math.ceil(M.length / 2) - 1] - } else if (S == 3) { - mediaEl = M[Math.ceil(M.length / 2)] - } else if (S == 2) { - mediaEl = M[Math.ceil(M.length / 2) - 1] + if (program.browser.name == "firefox") { + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 2) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2)] + } } else { - mediaEl = M[Math.ceil(M.length / 2)] + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 2) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2)] + } } break case 7: - if (S == 5) { - mediaEl = M[Math.ceil(M.length / 2)] - } else if (S == 4) { - mediaEl = M[Math.ceil(M.length / 2) - 1] - } else if (S == 3) { - mediaEl = M[Math.ceil(M.length / 2)] + if (program.browser.name == "firefox") { + if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = M[Math.ceil(M.length / 2) - 1] + if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 8: - if (S == 6) { - mediaEl = M[Math.ceil(M.length / 2) - 1] - } else if (S == 5) { - mediaEl = M[Math.ceil(M.length / 2)] - } else if (S == 4) { - mediaEl = M[Math.ceil(M.length / 2) - 1] - } else if (S == 3) { - mediaEl = M[Math.ceil(M.length / 2)] + if (program.browser.name == "firefox") { + if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = M[Math.ceil(M.length / 2) - 1] + if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } + } + break + case 9: + if (program.browser.name == "firefox") { + if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } + } else { + if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 10: - if (S == 8) { - mediaEl = M[Math.ceil(M.length / 2)] - } else if (S == 5) { - mediaEl = M[Math.ceil(M.length / 2)] - } else if (S == 4) { - mediaEl = M[Math.ceil(M.length / 2) - 1] - } else if (S == 3) { - mediaEl = M[Math.ceil(M.length / 2)] + if (program.browser.name == "firefox") { + if (S == 9) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = M[Math.ceil(M.length / 2) - 1] + if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break } diff --git a/src/modules/PostScanner.ts b/src/modules/PostScanner.ts index 67f5f57..1086723 100644 --- a/src/modules/PostScanner.ts +++ b/src/modules/PostScanner.ts @@ -21,9 +21,8 @@ export class PostScanner implements Module { let mediaEl = null let mediaType: MediaType = MediaType.UNDEFINED - let mediaURL: string = null - let selectedCarouselIndex: number + let selectedCarouselMediaSlideIndex: number let isLastMedia: boolean = false // Container @@ -35,8 +34,8 @@ export class PostScanner implements Module { // Media selector let mediaSelector: string = "._aagv" - let carouselLeftButtonSelector: string = "._aahh" - let carouselRightButtonSelector: string = "._aahi" + let carouselLeftButtonSelector: string = "._9zm0" + let carouselRightButtonSelector: string = "._9zm2" // Scanner begins if (isModal) { @@ -50,209 +49,333 @@ export class PostScanner implements Module { isCarousel = $article.querySelectorAll(carouselLeftButtonSelector).length !== 0 || $article.querySelectorAll(carouselRightButtonSelector).length !== 0 } - console.log(["$article", $article]) - /* Series images in a modal */ if (isCarousel) { - let multiMedia: any = Array.from( + let carouselMediaSlideElements: any = Array.from( ($article as any).querySelectorAll( "div > :first-child > :first-child > :first-child > ul li" ) ).filter((el: any) => el.firstChild != null && el.classList.length > 0) - if (multiMedia != null && multiMedia.length > 0) { - mediaEl = null - mediaURL = null - - if (process.env.DEV) { - console.log(["multiMedia", multiMedia]) - console.log(["multiMedia.length", multiMedia.length]) - } - - let carouselControlsArray: any = ($article as HTMLElement).querySelectorAll("article > :first-child > :first-child > :first-child > div:nth-child(2) > div") + if (carouselMediaSlideElements != null && carouselMediaSlideElements.length > 0) { + let carouselControlsArray: any = Array.from( + ($article as HTMLElement).querySelectorAll( + "article > :first-child > :first-child > :first-child > div:nth-child(2) > div" + ) + ).filter((el: any) => el.classList.length <= 2) // Detect current image index of carousel for (let i = 0; i < carouselControlsArray.length; i++) { - if (carouselControlsArray[i].classList.length >= 2) { - selectedCarouselIndex = i + if (carouselControlsArray[i].classList.length == 2) { + selectedCarouselMediaSlideIndex = i } // Is last media - if (selectedCarouselIndex == carouselControlsArray.length - 1) { + if (selectedCarouselMediaSlideIndex == carouselControlsArray.length - 1) { isLastMedia = true break } } - selectedCarouselIndex++ + selectedCarouselMediaSlideIndex++ if (process.env.DEV) { console.log(["carouselControlsArray", carouselControlsArray]) console.log(["carouselControlsArray.length", carouselControlsArray.length]) - console.log(["selectedCarouselIndex", selectedCarouselIndex]) + console.log(["selectedCarouselMediaSlideIndex", selectedCarouselMediaSlideIndex]) console.log(["isLastMedia", isLastMedia]) } - for (let i = 0; i < multiMedia.length; i++) { - if (multiMedia.length == 2) { + let M = carouselMediaSlideElements + let S = selectedCarouselMediaSlideIndex + for (let i = 0; i < M.length; i++) { + if (M.length == 2) { if (isLastMedia) { - mediaEl = multiMedia[1] + mediaEl = M[1] } else { - mediaEl = multiMedia[0] + mediaEl = M[0] } - } else if (multiMedia.length == 3) { + } else if (M.length == 3) { if (isLastMedia) { - mediaEl = multiMedia[2] + mediaEl = M[2] } else { - mediaEl = multiMedia[1] - console.log('ff') - console.log(mediaEl); - + mediaEl = M[1] } - } else if (multiMedia.length == 4) { + } else if (M.length == 4) { if (isLastMedia) { - mediaEl = multiMedia[2] + mediaEl = M[2] } else { // Dont mess with me Instagram!!! if (isModal && Math.max(document.documentElement.clientHeight || 0, window.innerHeight || 0) < 445) { switch (carouselControlsArray.length) { case 4: - if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 2) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 2) { + mediaEl = M[Math.ceil(M.length / 2) - 1] } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + mediaEl = M[Math.ceil(M.length / 2) - 1] } break case 5: - if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (program.browser.name == "firefox") { + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 6: - if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 2) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 2) { + mediaEl = M[Math.ceil(M.length / 2) - 1] } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] + mediaEl = M[Math.ceil(M.length / 2)] } break case 7: - if (selectedCarouselIndex == 5) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (program.browser.name == "firefox") { + if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 8: - if (selectedCarouselIndex == 7) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 6) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 5) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (program.browser.name == "firefox") { + if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 10: - if (selectedCarouselIndex == 9) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 8) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 5) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (program.browser.name == "firefox") { + if (S == 9) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 9) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break } } else { switch (carouselControlsArray.length) { case 4: - if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 2) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 2) { + mediaEl = M[Math.ceil(M.length / 2) - 1] } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + mediaEl = M[Math.ceil(M.length / 2) - 1] } break case 5: - if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] + if (program.browser.name == "firefox") { + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 6: - if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 2) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (program.browser.name == "firefox") { + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 2) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2)] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] + if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 2) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else { + mediaEl = M[Math.ceil(M.length / 2)] + } } break case 7: - if (selectedCarouselIndex == 5) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] + if (program.browser.name == "firefox") { + if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 8: - if (selectedCarouselIndex == 6) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 5) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] + if (program.browser.name == "firefox") { + if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break case 10: - if (selectedCarouselIndex == 8) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 5) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] - } else if (selectedCarouselIndex == 4) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] - } else if (selectedCarouselIndex == 3) { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2)] + if (program.browser.name == "firefox") { + if (S == 9) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 7) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 6) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } else { - mediaEl = multiMedia[Math.ceil(multiMedia.length / 2) - 1] + if (S == 8) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 5) { + mediaEl = M[Math.ceil(M.length / 2)] + } else if (S == 4) { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } else if (S == 3) { + mediaEl = M[Math.ceil(M.length / 2)] + } else { + mediaEl = M[Math.ceil(M.length / 2) - 1] + } } break }