Opera Discord



It's 1925 in Sicily, in a small town called Enna. There's a large mafia presence, among this is a theatre that is rumored to be occupied by some kind of phantom. HAPPY HOLIDAYS & MERRY CHRISTMAS EVERYBODY!This is our gift to you all! (yes.we know the estimated release date was Falland winter just started BUT WE DID. I've been using Opera Beta for a while, and in all honesty it is an amazing app. It allows me to view any webpage, even when at school. The only problem I really have with the app is that I can't use discord. I'm a pretty big gamer and well known within a.

  1. Opera Discord Rich Presence
  2. Opera Discord Sidebar
  3. Opera Discord Sidebar

Discord History Tracker is a browser script that lets you locally save chat history in your servers, groups, and private conversations.

Opera Discord

When the script is active, it will load history of the selected text channel up to the first message, and let you download it for offline viewing in your browser.

How to Save History

Running the Script

Option 1: Userscript

Preferred option. Requires a browser addon, but DHT will stay up-to-date and be easily accessible on the Discord website.

Discord
  1. Install a userscript manager addon:
    • Violentmonkey (Chrome)
    • Tampermonkey (Firefox, Edge, Chrome, Opera)
    • Due to browser bugs / limitations, DHT will not work in Firefox with Greasemonkey / Violentmonkey, and in Safari at all
  2. Click Install Userscript to prompt an installation into the userscript manager
  3. Open Discord, and view any server, group, or private conversation (it will not appear in Friends list)
  4. Click DHT in the top right corner:

Option 2: Browser Console

The console is the only way to use DHT directly in the desktop app.

  1. Click Copy to Clipboard to copy the script (requires JavaScript)
  2. Press Ctrl+Shift+I in your browser or the Discord app, and select the Console tab
  3. Paste the script into the console, and press Enter to run it
  4. Press Ctrl+Shift+I again to close the console
Discord

Opera Discord Rich Presence

Your browser may not support copying to clipboard, please try copying the script manually:

Opera

Option 3: Bookmarklet

Requires Firefox 69 or newer.

  1. Right-click 0?(--r,o(750)):(a>300&&(r=6,t.o(()=>{let e=i();e.scrollTop=e.scrollHeight/2},1)),e(),o(200))}else o(500)},o=function(e){s=t.o(a,e)};a(),window.l.push(()=>window.clearInterval(s))},h:function(e){var t=Object.keys(e||{}),n=t.find(e=>e.startsWith('__reactInternalInstance'));return n?e[n].memoizedProps:(n=t.find(e=>e.startsWith('__reactProps$')),n?e[n]:null)},g:function(){try{var n,i=t.i('privateChannels');if(i){if(!((u=t.i('selected',i))&&'href'in u&&u.href.includes('/@me/')))return null;var s=u.href.split('/'),r=s[s.length-1];if(!/^d+$/.test(r))return null;var a;for(let e of u.querySelectorAll('[class^='name-'] *')){let t=Array.prototype.find.call(e.childNodes,e=>e.nodeTypeNode.TEXT_NODE);if(t){a=t.nodeValue;break}}if(!a)return null;var o=u.querySelector('img[class*='avatar']'),l=o&&o.closest('foreignObject'),c=l&&l.getAttribute('mask');n={server:a,channel:a,id:r,type:c&&c.includes('#svg-mask-avatar-default')?'GROUP':'DM',extra:{}}}else{var u=(i=document.getElementById('channels')).querySelector('[class*='modeSelected']').parentElement,d=e.h(u).children.props;if(!d)return null;var f=d.channel||d.children().props.channel;if(!f)return null;n={server:document.querySelector('nav header > h1').innerText,channel:f.name,id:f.id,type:'SERVER',extra:{position:f.position,topic:f.topic,nsfw:f.nsfw}}}return 0n.channel.length?null:n}catch(e){return console.error(e),null}},p:function(){try{var t,n=i(),s=e.h(n);try{t=s.children.props.children.props.children.props.children.find(e=>Array.isArray(e))}catch(e){t=s.children.find(e=>Array.isArray(e))}var r=[];for(let e of t){let t=e.props;t&&t.message&&r.push(t.message)}return r}catch(e){return console.error(e),null}},v:()=>!!n(),S:function(){return nulldocument.querySelector('#messagesNavigationDescription + [class^=container]')},C:function(){let e=i();e.scrollTop>0&&(e.scrollTop=0)},T:function(){var e=t.i('privateChannels');if(e){var n=t.i('selected',e);return!!((l=n&&n.nextElementSibling)&&l.getAttribute('class').includes('channel-')&&'href'in l&&l.href.includes('/@me/'))&&(l.click(),l.scrollIntoView(!0),!0)}var i=e=>e.includes('wrapper-')&&!e.includes('clickable-'),s=e=>!!e.querySelector('path[d='M5.88657 21C5.57547 21 5.3399 20.7189 5.39427 20.4126L6.00001 17H2.59511C2.28449 17 2.04905 16.7198 2.10259 16.4138L2.27759 15.4138C2.31946 15.1746 2.52722 15 2.77011 15H6.35001L7.41001 9H4.00511C3.69449 9 3.45905 8.71977 3.51259 8.41381L3.68759 7.41381C3.72946 7.17456 3.93722 7 4.18011 7H7.76001L8.39677 3.41262C8.43914 3.17391 8.64664 3 8.88907 3H9.87344C10.1845 3 10.4201 3.28107 10.3657 3.58738L9.76001 7H15.76L16.3968 3.41262C16.4391 3.17391 16.6466 3 16.8891 3H17.8734C18.1845 3 18.4201 3.28107 18.3657 3.58738L17.76 7H21.1649C21.4755 7 21.711 7.28023 21.6574 7.58619L21.4824 8.58619C21.4406 8.82544 21.2328 9 20.9899 9H17.41L16.35 15H19.7549C20.0655 15 20.301 15.2802 20.2474 15.5862L20.0724 16.5862C20.0306 16.8254 19.8228 17 19.5799 17H16L15.3632 20.5874C15.3209 20.8261 15.1134 21 14.8709 21H13.8866C13.5755 21 13.3399 20.7189 13.3943 20.4126L14 17H8.00001L7.36325 20.5874C7.32088 20.8261 7.11337 21 6.87094 21H5.88657ZM9.41045 9L8.35045 15H14.3504L15.4104 9H9.41045Z']')||!!e.querySelector('path[d='M14 8C14 7.44772 13.5523 7 13 7H9.76001L10.3657 3.58738C10.4201 3.28107 10.1845 3 9.87344 3H8.88907C8.64664 3 8.43914 3.17391 8.39677 3.41262L7.76001 7H4.18011C3.93722 7 3.72946 7.17456 3.68759 7.41381L3.51259 8.41381C3.45905 8.71977 3.69449 9 4.00511 9H7.41001L6.35001 15H2.77011C2.52722 15 2.31946 15.1746 2.27759 15.4138L2.10259 16.4138C2.04905 16.7198 2.28449 17 2.59511 17H6.00001L5.39427 20.4126C5.3399 20.7189 5.57547 21 5.88657 21H6.87094C7.11337 21 7.32088 20.8261 7.36325 20.5874L8.00001 17H14L13.3943 20.4126C13.3399 20.7189 13.5755 21 13.8866 21H14.8709C15.1134 21 15.3209 20.8261 15.3632 20.5874L16 17H19.5799C19.8228 17 20.0306 16.8254 20.0724 16.5862L20.2474 15.5862C20.301 15.2802 20.0655 15 19.7549 15H16.35L16.6758 13.1558C16.7823 12.5529 16.3186 12 15.7063 12C15.2286 12 14.8199 12.3429 14.7368 12.8133L14.3504 15H8.35045L9.41045 9H13C13.5523 9 14 8.55228 14 8Z']'),r=e=>e.childElementCount>0&&i(e.children[0].className)&&s(e),a=document.querySelector('div[class*='sidebar'] > nav[class*='container'] > div[class*='scroller']');if(!a)return!1;for(var o=Array.prototype.filter.call(a.querySelectorAll('[class*='containerDefault']'),r),l=null,c=0;c{var s=document.createElement(e);s.id=n||';s.innerHTML=i||';t.appendChild(s);return s};return{id:(e,t)=>(t||document).getElementById(e),i:(e,t)=>(t||document).querySelector(`[class*='${e}-']`),createElement:(t,n,i,s)=>e(t,n,i,s),O:e=>e.parentNode.removeChild(e),A:t=>e('style',document.head,',t),o:(e,t)=>window.setTimeout(e,t),L:(e,t,n)=>e.addEventListener(t,n),k:(e,t,n)=>{var i=new Date(Date.now()+1e3*n).toUTCString();document.cookie=e+'='+encodeURIComponent(JSON.stringify(t))+';path=/;expires='+i},M:e=>{var t=document.cookie.replace(new RegExp('(?:(?:^|.*;s*)'+e+'s*=s*([^;]*).*$)|^.*$'),'$1');return t.length?JSON.parse(decodeURIComponent(t)):null},_:(t,n)=>{var i=new Blob([n],{type:'octet/stream'});if('msSaveBlob'in window.navigator)return window.navigator.msSaveBlob(i,t);var s=window.URL.createObjectURL(i);var r=e('a',document.body);r.href=s;r.download=t;r.style.display='none';r.click();document.body.removeChild(r);window.URL.revokeObjectURL(s)}}}(),n=function(){var e,n,r=()=>{o.N()?(e.H.U.disabled=!0,e.H.R.disabled=!0,e.H.D.disabled=!0):(e.H.U.disabled=!1,e.H.R.disabled=!1,e.H.I.disabled=e.H.D.disabled=!o.F())},l=(t,i)=>{if(e){var s='gui't&&'controller'i;if(('data't||s)&&r(),('tracking't||s)&&(r(),e.H.q.innerHTML=o.N()?'Pause Tracking':'Start Tracking'),'data't||s){var l=0,c=0;o.F()&&(l=o.j().P(),c=o.j().W()),e.H.V.innerHTML=[l,' message',1l?':'s',' from ',c,' channel',1c?':'s'].join(')}}if(n&&((s='gui't&&'settings'i)&&(n.H.G.checked=a.autoscroll,n.H.B[a.afterFirstMsg].checked=!0,n.H.J[a.afterSavedMsg].checked=!0),'setting't||s)){var u=!a.autoscroll;Object.values(n.H.B).forEach(e=>e.disabled=u),Object.values(n.H.J).forEach(e=>e.disabled=u)}},c=!1,u=function(e){c||(o.$(l),a.Z(l),c=!0),l('gui',e)},d={X:function(){(e={}).K=t.A(`rn#app-mount > div[class*='app-'] { margin-bottom: 48px !important; }rn#dht-ctrl { position: absolute; bottom: 0; width: 100%; height: 48px; background-color: #FFF; }rn#dht-ctrl button { height: 32px; margin: 8px 0 8px 8px; font-size: 16px; padding: 0 12px; background-color: #7289DA; color: #FFF; text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.75); }rn#dht-ctrl button:disabled { background-color: #7A7A7A; cursor: default; }rn#dht-ctrl-close { margin: 8px 8px 8px 0 !important; float: right; }rn#dht-ctrl p { display: inline-block; margin: 14px 12px; }rn#dht-ctrl input { display: none; }`);var n=(e,t)=>'';e.Y=t.createElement('div',document.body,'dht-ctrl',`rn${n('upload','Upload & Combine')}rn${n('settings','Settings')}rn${n('track',')}rn${n('download','Download')}rn${n('reset','Reset')}rnrnrn${n('close','X')}`),e.H={U:t.id('dht-ctrl-upload'),R:t.id('dht-ctrl-settings'),q:t.id('dht-ctrl-track'),I:t.id('dht-ctrl-download'),D:t.id('dht-ctrl-reset'),ee:t.id('dht-ctrl-close'),V:t.id('dht-ctrl-status'),ne:t.id('dht-ctrl-upload-input')},t.L(e.H.U,'click',()=>{e.H.ne.click()}),t.L(e.H.R,'click',()=>{d.ie()}),t.L(e.H.q,'click',()=>{o.se(!o.N())}),t.L(e.H.I,'click',()=>{o.ae()}),t.L(e.H.D,'click',()=>{o.oe()}),t.L(e.H.ee,'click',()=>{d.le();window.l.forEach(e=>e());window.DHT_LOADED=!1}),t.L(e.H.ne,'change',()=>{Array.prototype.forEach.call(e.H.ne.files,e=>{var t=new FileReader;t.onload=function(){var n={};try{n=JSON.parse(t.result)}catch(t){return alert('Could not parse '+e.name+', see console for details.'),void console.error(t)}i.ce(n)?o.ue(e.name,new i(n)):alert('File '+e.name+' has an invalid format.')};t.readAsText(e,'UTF-8')});e.H.ne.value=null}),u('controller')},le:function(){e&&(t.O(e.Y),t.O(e.K),e=null)},ie:function(){(n={}).K=t.A(`rn#dht-cfg-overlay { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background-color: #000; opacity: 0.5; display: block; z-index: 1000; }rn#dht-cfg { position: absolute; left: 50%; top: 50%; width: 800px; height: 262px; margin-left: -400px; margin-top: -131px; padding: 8px; background-color: #fff; z-index: 1001; }rn#dht-cfg-note { margin-top: 22px; }rn#dht-cfg sub { color: #666; font-size: 13px; }`),n.de=t.createElement('div',document.body,'dht-cfg-overlay'),t.L(n.de,'click',()=>{d.fe()});var e=(e,t,n)=>'
    ';n.Y=t.createElement('div',document.body,'dht-cfg',`rn
    rn
    rn
    rn${e('afm','nothing','Do Nothing')}rn${e('afm','pause','Pause Tracking')}rn${e('afm','switch','Switch to Next Channel')}rn
    rn
    rn${e('asm','nothing','Do Nothing')}rn${e('asm','pause','Pause Tracking')}rn${e('asm','switch','Switch to Next Channel')}rn

    rnIt is recommended to disable link and image previews to avoid putting unnecessary strain on your browser.
    rnv.31, released 3 April 2021rn

    `),n.H={G:t.id('dht-cfg-autoscroll'),B:{},J:{}},n.H.B[s.he]=t.id('dht-cfg-afm-nothing'),n.H.B[s.ge]=t.id('dht-cfg-afm-pause'),n.H.B[s.me]=t.id('dht-cfg-afm-switch'),n.H.J[s.he]=t.id('dht-cfg-asm-nothing'),n.H.J[s.ge]=t.id('dht-cfg-asm-pause'),n.H.J[s.me]=t.id('dht-cfg-asm-switch'),n.H.G.addEventListener('change',()=>{a.autoscroll=n.H.G.checked}),Object.keys(n.H.B).forEach(e=>{t.L(n.H.B[e],'click',()=>{a.afterFirstMsg=e})}),Object.keys(n.H.J).forEach(e=>{t.L(n.H.J[e],'click',()=>{a.afterSavedMsg=e})}),u('settings')},fe:function(){n&&(t.O(n.de),t.O(n.Y),t.O(n.K),n=null)}};return d}();class i{constructor(e){var t=this;i.ce(e)||(e={meta:{},data:{}}),t.meta=e.meta,t.data=e.data,t.meta.users=t.meta.users||{},t.meta.userindex=t.meta.userindex||[],t.meta.servers=t.meta.servers||[],t.meta.channels=t.meta.channels||{},t.pe={ve:{},Se:new Set,Ce:new Set,Te:new Set}}static ce(e){return e&&'object'typeof e.meta&&'object'typeof e.data}ye(e,t,n,i){var s=e in this.meta.users,r=s?this.meta.users[e]:{};return r.name=t,n&&(r.tag=n),i&&(r.avatar=i),s?e in this.pe.ve?this.pe.ve[e]:this.pe.ve[e]=this.meta.userindex.findIndex(t=>te):(this.meta.users[e]=r,this.meta.userindex.push(e),this.pe.ve[e]=this.meta.userindex.length-1)}Oe(e,t){var n=this.meta.servers.findIndex(n=>n.namee&&n.typet);return-1n?(this.meta.servers.push({name:e,type:t}),this.meta.servers.length-1):n}Ae(e,t,n,i){if(this.meta.servers[e]){var s=t in this.meta.channels,r=s?this.meta.channels[t]:{server:e};return r.name=n,i.position&&(r.position=i.position),i.topic&&(r.topic=i.topic),i.nsfw&&(r.nsfw=i.nsfw),!s&&(this.meta.channels[t]=r,this.pe.Se.add(t),!0)}}we(e,t,n){var i=this.data[e]||(this.data[e]={}),s=t in i;return i[t]=n,this.pe.Ce.add(t),!s}be(e){var t=e.author,n={u:this.ye(t.id,t.username,t.bot?null:t.discriminator,t.avatar),t:e.timestamp.toDate().getTime()};return e.content.length>0&&(n.m=e.content),null!e.editedTimestamp&&(n.te=e.editedTimestamp.toDate().getTime()),e.embeds.length>0&&(n.e=e.embeds.map(e=>{let t={url:e.url,type:e.type};'rich'e.type&&Array.isArray(e.title)&&1e.title.length&&'string'typeof e.title[0]&&(t.t=e.title[0],Array.isArray(e.description)&&1e.description.length&&'string'typeof e.description[0]&&(t.d=e.description[0]));return t})),e.attachments.length>0&&(n.a=e.attachments.map(e=>({url:e.url}))),null!e.messageReference&&(n.r=e.messageReference.message_id),e.reactions.length>0&&(n.re=e.reactions.map(e=>{let t={c:e.count,n:e.emoji.name};null!e.emoji.id&&(t.id=e.emoji.id);e.emoji.animated&&(t.an=!0);return t})),n}Le(e){return this.pe.Te.has(e)}ke(e,t){var n=!1;for(var i of t){var s=i.type;0!s&&19!s||'SENT'!i.state||!this.we(e,i.id,this.be(i))||(this.pe.Te.add(i.id),n=!0)}return n}W(){return this.pe.Se.size}P(){return this.pe.Ce.size}Me(e){var t={},n=!1;for(var i in e.meta.users){var s=e.meta.users[i];t[e.meta.userindex.findIndex(e=>ei)]=this.ye(i,s.name,s.tag,s.avatar)}for(var r in e.meta.channels){var a=e.meta.servers[e.meta.channels[r].server],o=e.meta.channels[r];this.Ae(this.Oe(a.name,a.type),r,o.name,o)}for(var r in e.data){o=e.data[r];for(var l in o){var c=o[l];(s=c.u)in t?(c.u=t[s],this.we(r,l,c)):(n||(n=!0,alert('The uploaded archive appears to be corrupted, some messages will be skipped. See console for details.'),console.error('User list:',e.meta.users),console.error('User index:',e.meta.userindex),console.error('Generated mapping:',t),console.error('Missing user for the following messages:')),console.error(c))}}}_e(){return JSON.stringify({meta:this.meta,data:this.data})}}var s={he:'optNothing',ge:'optPause',me:'optSwitch'},r=!1,a=function(){var e={},n=[],i=function(){t.k('DHT_SETTINGS',e,15768e4)},a=function(e,t){for(var s of n)s(e,t);i()},o=function(e,t,n){var i='_'+t;Object.defineProperty(e,t,{get:()=>e[i],set:n=>{e[i]=n;a('setting',t)}}),e[i]=n},l=t.M('DHT_SETTINGS');return l||(l={_autoscroll:!0,_afterFirstMsg:s.ge,_afterSavedMsg:s.ge},r=!0),o(e,'autoscroll',l._autoscroll),o(e,'afterFirstMsg',l._afterFirstMsg),o(e,'afterSavedMsg',l._afterSavedMsg),e.Z=function(e){n.push(e)},r&&i(),e}(),o=function(){var e=[],n=function(t,n){for(var i of e)i(t,n)};class s{constructor(){this.oe()}oe(){this.Ne=null,this.Ue=!1,this.He=null,n('data','reset')}j(){return this.Ne||(this.Ne=new i),this.Ne}F(){return null!=this.Ne}N(){return this.Ue}se(e){this.Ue=e,n('tracking',e)}ue(e,t){this.He=e,this.j().Me(t),n('data','upload')}ae(){this.F()&&t._(this.He||'dht.txt',this.Ne._e())}Re(e,t,i,s,r){var a=this.j().Oe(e,t);!0this.j().Ae(a,i,s,r)&&n('data','channel')}Ee(e,t){return!!this.j().ke(e,t)&&(n('data','messages'),!0)}Le(e){return this.j().Le(e)}$(t){e.push(t)}}return new s}();const l=window.location.href;if(!l.includes('discord.com/')&&!l.includes('discordapp.com/')&&!confirm('Could not detect Discord in the URL, do you want to run the script anyway?'))return;if(window.DHT_LOADED)return void alert('Discord History Tracker is already loaded.');window.DHT_LOADED=!0,window.l=[];let c=new Set,u=null,d=function(e){c.add('stopping'),t.o(()=>{o.se(!1);c.delete('stopping');e&&e()},200)};e.s(()=>{if(o.N()&&0c.size){let n=e.g();if(!n)return void d();o.Re(n.server,n.type,n.id,n.channel,n.extra);let i=e.p();if(nulli)return void d();if(!i.length)return void e.C();let r=o.Ee(n.id,i);if(a.autoscroll){let l=null;r||o.Le(i[0].id)?e.S()||(l=a.afterFirstMsg):l=a.afterSavedMsg,nulll?r?(e.C(),window.clearTimeout(u),u=null):u=window.setTimeout(e.C,2500):(c.add('stalling'),t.o(()=>{c.delete('stalling');let t=e.g();if(t&&t.idn.id){let t=e.p();null!=t&&o.Ee(n.id,t)}(ls.me&&!e.T()||ls.ge)&&o.se(!1)},250))}}}),o.$((t,n)=>{if('tracking't&&n){let t=e.g();if(!t)return void d(()=>alert('The selected channel is not visible in the channel list.'));{let n=e.p();if(nulln)return void d(()=>alert('Cannot see any messages.'));o.Re(t.server,t.type,t.id,t.channel,t.extra),o.Ee(t.id,n)}if(a.autoscroll&&e.v())if(e.S())e.C();else{let t=a.afterFirstMsg;(ts.me&&!e.T()||ts.ge)&&d()}}}),n.X(),r&&n.ie();})()' onauxclick='return false;'>Discord History Tracker
  2. Select «Bookmark This Link» and save the bookmark
  3. Open Discord and click the bookmark to run the script

Old Versions

Whenever DHT is fixed to work with a recent Discord update, it will no longer work on the previous version of Discord.

If you haven't received that Discord update yet, see Release Notes for information about recent updates, and Old Versions if you need to use an older version of DHT.

Using the Script

When running for the first time, you will see a Settings dialog where you can configure the script. These settings will be remembered as long as you don't delete cookies in your browser.

By default, Discord History Tracker is set to pause tracking after it reaches a previously saved message to avoid unnecessary history loading. You may also set it to load all channels in the server or your friends list by selecting Switch to Next Channel.

Once you have configured everything, upload your previously saved archive (if you have any), click Start Tracking, and let it run. After the script saves all messages, download the archive.

How to View History

Browser with discord

Download the Viewer, open it in your browser, and load the archive. By downloading it to your computer, you can view archives offline, and allow the browser to load image previews that might otherwise not load if the remote server prevents embedding them.

External Links

Issues & Suggestions — Source Code — Follow Dev on Twitter — Support via Patreon — Support via Ko-fi

Disclaimer

Opera Discord Sidebar

Discord History Tracker and the viewer are fully client-side and do not communicate with any servers – the terms 'Upload' and 'Download' only refer to your browser. If you close your browser while the script is running, all unsaved progress will be lost.

Opera Discord Sidebar

Please, do not use this script for large or public servers. The script was made as a convenient way of keeping a local copy of private and group chats, as Discord is currently lacking this functionality.