medialab / hyphe

Websites crawler with built-in exploration and control web interface
http://hyphe.medialab.sciences-po.fr/demo/
GNU Affero General Public License v3.0
326 stars 59 forks source link

[front/prospect] Add button to open all webentities in new tabs #170

Closed debcarpe closed 7 years ago

debcarpe commented 8 years ago

I suggest a bottom in the Prospectus to open all the 20 webentities on each page of this section. Thank you!

boogheta commented 7 years ago

Hey @debcarpe (ccing @pierrejdlf who was interested as well by such feature)

Such feature should probably not be embedded within Hyphe for various performance/security/commonsense reasons :)

Alhough, I can understand it could reveal useful in some cases, so here's a proposed workaround (only for Firefox & Chrome, with an extra requirements detailed below for the latter) which you can use by pasting the following lines in your browser console whenever you are in a List/Prospect webentities page:

$("webentity-link .btn-link").each(function(i, el){
  setTimeout(function(){
    console.log("Opening "+ el.href + " in new tab");
    el.click();
  }, 100 * i)
});

Another simpler way to do that is to install a dedicated bookmarklet in your browser: activate the display of your browser's Personal/Favorites/Bookmarks bar, then right click on it to create a new Bookmark, give it the name you like for instance "Open Hyphe WebEntities" then paste in the adress/url place the following code:

javascript:(function(){$("webentity-link .btn-link").each(function(i,el){setTimeout(function(){el.click()},100*i)})})()

Note that Firefox and Chrome will usually block all new tabs the first time you use it and display an icon of a window with a red cross to let you know it blocked popups. Click on it to allow popups for Hyphe's website and you can now use it properly.

Note also that Chrome forbids you by default to open new tabs in the background and normally takes the focus. First install the Force Background Tabs that will allow you to enforce this behavior (with the small light blue folder icon that is added on the right of the urlbar)

boogheta commented 7 years ago

and on a side note, this specific usecase is one of the reasons for the development https://github.com/medialab/hyphe-browser