Wikipedia Inline Article Viewer [adopted]

Adds a hover event to internal article links on wikipedia pages which, opens the article inline in a dhtml frame.

< Feedback on Wikipedia Inline Article Viewer [adopted]

Review: Good - script works

§
Posted: 18-01-2022

The script is great, could it be used to work on all sites?

joeytwiddleAuthor
§
Posted: 21-01-2022
Edited: 21-01-2022

Possibly, but I'm not sure I'll have time to work on that.

A couple of concerns:

  • It's might not be safe on all sites. Some sites take action on an HTTP GET request. (They shouldn't do that, but some sites do.) In this case, simply hovering over the link might perform some action on the website! (When we fetch the content, the site thinks we clicked the link.) This could be problematic if the link was a "delete" button or something like that!

  • Appearance: Many sites now block third-party iframes for security reasons. Which means we won't get the CSS, so the content will look ugly. Therefore we would probably want to strip the target page down to its content, removing headers and sidebars. This is not a trivial task. (We do this for wiki pages, but we can hard-code that, because we already know the structure of the target page.) There are some npm packages which try to solve this with heuristics, but it's likely they won't work in the browser, so the userscript might need to use a server, argh! Or we'd need to write a browser-only version of this.

However, if you want to do this only for simple static sites, hovering only links on the same site, then you may try the "hover_preview" static bookmarklet from here:

USE AT YOUR OWN RISK!

Post reply

Sign in to post a reply.