anthe.sevenants

How to make the English Corpora website wider

2022-04-18

Anyone who's worked with BYU English Corpora knows that the website is... quite special. One of the quirks of the site is that the main container does not scale with your window's size. This means that you could be working on a 4K screen while getting the same content shown to you as on a screen with a resolution four times smaller. Inevitably, this means you get scrollbars even though your screen is plenty wide.

To solve this, I wrote a userscript a long time ago, and it still works. BYU English Corpora makes heavy use of iframes (shudder), the size of which is determined via the cols attribute. My userscript sets the main frame's width to 70% of the screen width, which means it scales perfectly for all display sizes.

Example

Before

Before: English Corpora with scroll bars

Horizontal scrollbars appear, even though there is ample room to display all KWIC lines.

After

After: English Corpora without scroll bars

The horizontal scrollbars are gone. Every corpus example now fits on a single line.

How to install

  1. Install Tampermonkey. This is a userscript manager for modern browsers.
  2. Click here and install the script