Hacker Newsnew | past | comments | ask | show | jobs | submit | archb's commentslogin

Do you mind sharing the script?


    // ==UserScript==
    // @name        ycombinator
    // @namespace   Violentmonkey Scripts
    // @match       https://news.ycombinator.com/*
    // @grant       GM_addStyle
    // @version     1.0
    // @author      -
    // @description 10/5/2022, 6:35:39 PM
    // ==/UserScript==

    GM_addStyle(`
      .pagetop { color: #fff }
      body .title { font: 19px/1.5 sans-serif }
      body a, body a:link { color: #222 }
      body .comhead { font-size: 16px; font-style: italic }
      body .title .rank { color: #aaa; font-size: 14px }
      body .subtext { font-size: 16px; padding: 4px 0 6px 19px }
      .c00, .c00 a:link { color: #444 } body .comment { font: 16px/1.45 sans-serif; max-width: none }
      body span.pagetop a, body span.pagetop a:visited { color: #fff }
      body tr.athing:not(.comtr):nth-child(even) { background: linear-gradient(#f4f4f4, #eee, #f4f4f4) }
      body tr.athing > td { padding: 5px 10px 5px 1px }
      body tr.athing > td.votelinks { padding-right: 5px }
      td.zoom { font-weight: 700; color: #fff; width: 32px }
      td.zoom > span { cursor: pointer; font-size: 1.5rem }
      div.toptext { font-size: 17px; color: #333 }
      span.number-of-comments { font-size: 18px; color: #666 }
    `);

    const t = document.getElementById('hnmain');
    if (t != null) {
      t.removeAttribute('bgcolor');
      t.removeAttribute('width');
      t.parentNode.removeChild(t);
      document.body.prepend(t);
    }

    const spanPagetop = document.querySelector('td span.pagetop');
    if (spanPagetop) {
      const tr = spanPagetop.parentElement.parentElement;
      tr.insertAdjacentHTML('afterbegin', `
        <td class="zoom"><span onclick="zoomIn(); return false">+</span></td>
        <td class="zoom"><span onclick="zoomOut(); return false">-</span></td>
      `);
    }

    setTimeout(function() {
      while (true) {
        const td = document.querySelector('tr:not([id]) > td.subtext');
        if (td == null) {
          break;
        }

        const tr = td.parentElement;
        const previousTr = tr.previousElementSibling;
        if (previousTr != null) {
          tr.parentElement.removeChild(tr);
          previousTr.append(td);
        } else {
          break;
        }
      }

      while (true) {
        const tr = document.querySelector('tr.spacer');
        if (tr == null) {
          break;
        }
        tr.parentElement.removeChild(tr);
      }

      document.querySelectorAll('td.title[valign="top"]').forEach(td => td.setAttribute('valign', 'middle'));

      document.querySelectorAll('table > tbody > tr:has(> td + td + td + td) + tr + tr > td[colspan="2"]:first-child + td:last-child').forEach(td => {
        td.setAttribute('colspan', '2');
      });

      document.querySelectorAll('a[href^="item?id="]').forEach(a => {
        const arr = a.innerHTML.split('&nbsp;');
        if (arr.length == 2) {
          a.innerHTML = `<span class="number-of-comments">${arr[0]}</span> ${arr[1]}`;
        }
      });
    }, 419);

    const myScript = document.createElement('script');
    myScript.innerHTML = `
      const FONT_SIZE_THRESHOLD = 26.9;
      function zoomIn() {
        const bodyTitle = document.querySelector('body .title');
        if (bodyTitle) {
          const newFontSize = parseFloat(getComputedStyle(bodyTitle).getPropertyValue('font-size').replace('px', '')) + 1;
          document.querySelectorAll('body .title').forEach(t => {
            t.style.fontSize = newFontSize + 'px';
            if (newFontSize > FONT_SIZE_THRESHOLD) t.style.fontWeight = 300;
          });
        }
        const bodyComment = document.querySelector('body .comment');
        if (bodyComment) {
          const newFontSize = parseFloat(getComputedStyle(bodyComment).getPropertyValue('font-size').replace('px', '')) + 1;
          document.querySelectorAll('body .comment').forEach(t => {
            t.style.fontSize = newFontSize + 'px';
            if (newFontSize > FONT_SIZE_THRESHOLD) t.style.fontWeight = 300;
          });
        }
      }

      function zoomOut() {
        const bodyTitle = document.querySelector('body .title');
        if (bodyTitle) {
          const newFontSize = parseFloat(getComputedStyle(bodyTitle).getPropertyValue('font-size').replace('px', '')) - 1;
          if (newFontSize > 12) document.querySelectorAll('body .title').forEach(t => {
            t.style.fontSize = newFontSize + 'px';
            if (newFontSize < FONT_SIZE_THRESHOLD) t.style.fontWeight = 400;
          });
        }
        const bodyComment = document.querySelector('body .comment');
        if (bodyComment) {
          const newFontSize = parseFloat(getComputedStyle(bodyComment).getPropertyValue('font-size').replace('px', '')) - 1;
          if (newFontSize > 12) document.querySelectorAll('body .comment').forEach(t => {
            t.style.fontSize = newFontSize + 'px';
            if (newFontSize < FONT_SIZE_THRESHOLD) t.style.fontWeight = 400;
          });
        }
      }
    `;
    document.head.appendChild(myScript);


I think it does use JMAP because that's how the core Fastmail web experience works.


Mostly performance benefits that JMAP enables, and masked email addresses feature for example. - https://www.fastmail.com/blog/how-and-why-we-built-masked-em...


Yes, the keyboard shortcuts are available, but I am unable to see browser navigation shortcuts like 'command + left arrow' to navigate to the previous page.


It should be JMAP because that's the primary protocol that Fastmail as a email hosting company (not a email client) operates on.

I don't think that's open source based on the blog post alone, and I don't think they have a reason to build a separate email client with advanced features. This app is likely just meant to serve the needs of the business clients that have asked for a separate app rather than using the website.


Do you mean to access Fastmail as a client for your Gmail-hosted inbox? How about using the fetch feature that moves all emails to your Fastmail inbox, and the 'send as' feature where you can send emails out from your Gmail SMTP via Fastmail. Those two features already exist.


Although when setting this up, Gmail really make you feel like they might pull support at any minute.

I wonder if Fastmail could log you in to Gmail in a way that's consistent with Google's security model, similar to how you can "log in with Google" on many services. I'd much prefer it over the app password thing.


Now that you mention it, I remember that's how Fastmail works today. They use app passwords for non-Google-hosted email inboxes, and 'login with Google' for Google-hosted inboxes.


Not exactly. I use Fastmail to avoid using Google.

However there are tons of services that require Google (or outlook) to work with your emails.


On the same boat as everybody else that this is electron based and not a great experience. I think from a business perspective this is just meant to satisfy those customers that are asking for a standalone app.


It doesn't seem to be the free Google account either. The fact it happened to a paid Google Workspace account is pretty concerning.


On the contrary, it is their current design that makes me like it more than other options.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: