vernal poolonline staff

Mittineague

No Pop-up Links GreaseMonkey Userscript

There are 43 plants in blossom on September the 2nd.
Beggar Ticks Bidens frondosa blossoms between Aug 29 and Sep 22
Birdsfoot Trefoil Lotus corniculatus Jun 20 to Sep 05
Bittersweet Nightshade Solanum dulcamara May 30 to Sep 06
Black-eyed Susan Rudbeckia serotina Jun 18 to Sep 06
Black Nightshade Solanum nigrum Jun 29 to Sep 06
Boneset Eupatorium perfoliatum Aug 03 to Sep 06
Bouncing Bet Saponaria officinalis Jun 03 to Aug 31
Butter-and-eggs Linaria vulgaris Jul 10 to Sep 20
Celandine Chelidonium majus May 07 to Sep 11
Chicory Cichorium intybus Jun 28 to Oct 24
Common Dodder Cuscuta gronovii Sep 02 to Oct 02
Common Evening Primrose Oenothera biennis Aug 02 to Sep 20
Common Ragweed Ambrosia artemisiifolia Jul 20 to Sep 20
Common St. Johnswort Hypericum perforatum Jun 08 to Sep 26
Daisy Fleabane Erigeron annuus May 30 to Oct 24
Fall Dandelion Leontodon autumnalis Aug 02 to Sep 30
Field Hawkweed Hieracium pratense May 23 to Sep 07
Galinsoga Galinsoga ciliata Aug 01 to Oct 11
Horseweed Erigeron canadensis Aug 12 to Sep 06
Jimson Weed Datura stramonium Jul 22 to Sep 06
Lady's Thumb Polygonum persicaria Aug 12 to Oct 20
Nodding Smartweed Polygonum lapathifolium Aug 12 to Oct 22
Pale Touch-me-not Impatiens pallida Aug 22 to Sep 06
Pink Knotweed Polygonum pensylvanicum Aug 12 to Sep 11
Purple Coneflower Echinacea purpurea Jul 15 to Sep 06
Queen Anne's Lace Daucus carota Jul 09 to Sep 07
Red Clover Trifolium pratense May 23 to Oct 24
Round-headed Bush Clover Lespedeza capitata Sep 03 to Sep 04
Shrubby Cinquefoil Potentilla fruticosa Jun 03 to Sep 19
Spearmint Mentha spicata Aug 01 to Sep 06
Spotted Knapweed Centaurea maculosa Jul 31 to Sep 20
Spotted Touch-me-not Impatiens capensis Jul 01 to Sep 11
Sweet Everlasting Gnaphalium obtusifolium Aug 28 to Oct 24
Sweet Goldenrod Solidago odora Jul 31 to Sep 20
Tall Rattlesnake Root Prenanthes trifoliata Aug 27 to Sep 06
Tansy Tanacetum vulgare Jul 18 to Sep 11
Three-seeded Mercury Acalypha rhomboidea ....
// ==UserScript==
// @name           No Pop-up Links
// @namespace      http://www.mittineague.com/dev/
// @description    Changes pop-up links to regular links
// @include        *
// @exclude     http://www.mittineague.com/blog/wp-admin/*
// ==/UserScript==
 
/*
 * No Pop-up Links -  nopopuplinks.user.js version 1.6
 * Author: Mittineague <N/A> (N/A) http://www.mittineague.com
 *
 * script hosted at http://www.mittineague.com/dev/nopopuplinks.user.js
 * and can be found at http://userscripts.org/scripts/show/5273
 *
 * Change Log
 * version 1.0 - August 23, 2006
 * version 1.1 - August 23, 2006  // added removal of target="_blank"
 * version 1.2 - August 30, 2006  // added removal of scripted pop-ups, added option vars
 * version 1.3 - September 1, 2006  // made "target" "blank" only for frame functionality
 * version 1.4 - September 3, 2006  // added open = null for external scripts
 *          // added form target="_blank"
 * version 1.5 - October 8, 2006  // regex improvement, added '-' and '_'
 * version 1.6 - November 15, 2006  // added (function(){ [CODE] })();
 * 
 * FEEDBACK REQUESTED
 * If anyone using this script finds a pop-up link (other than CSS hide -> display)
 * that is not nullified please leave a comment at http://www.mittineague.com/cont.php
 * 
 * To Do - Restore link functionality to scripted pop-ups
 *
 * This script searches for "window.open" in every anchor
 * It will work for pop-ups in these formats:
 *   <a href="javascript:window.open ....
 *   <a href="#" onclick="window.open ....
 *  <a .... target="_blank"
 *
 * The above alone does not prevent scripted pop-ups. That is, those techniques which
 * do not have "window.open" in the link, but rather in a script that's either called
 * from the link or an event handler, such as:
 *  <a href="javascript:functionName ....
 *  <a href="#" onclick="functionName ....
 *  <a class="X ....
 *  Setting this option to "true" - BREAKS LINK - unless URL is in href
 *
 * The link regular expression logic (case-insensitive) is as follows:
 *   any or no character  ~  followed by
 *   window.open(' or window.open("  ~  followed by
 *   http:// or https:// or not  ~  followed by
 *   www. or not  ~  followed by
 *   any one or more letters, numbers, forward slashes or periods  ~  up to
 *   the first character that is a hash, question mark, quote or white-space
 *
 * Note: The link will be stripped of any GET variables or anchor hashes
 *  eg. page.html?var=val will become page.html
 *  page.html#top will become page.html
 *
 *  If the pop-up is attempting to open multiple windows the link will be the first.
 *  eg. window.open{"one.html","","");window.open{"two.html","",""); will become one.html
 *
 *  New functions with "window.open" removed from their content are appended to the body
 *  to over-ride any loaded during onload. - MAY BREAK LINK
 *
 *  nullify_all "true" will over-ride ALL scripted "open"s - MAY BREAK LINK
 *  This is not as defensive as turning off javascript. But it's close.
 *
 *  form_targets "true" prevents form result "_blank"s
 *
 *  *** There are some instances where the use of a pop-up is justified.
 *  eg. instructions for a multi-page form, maps, click for larger image, etc.
 *  This script can be customized by adding sites to the @exclude above
 *  or by setting various PREFERENCE OPTIONS to "false"
 */
 
(function(){
 
/* PREFERENCE OPTIONS */
var remove_href_popups = "true"; // <a href="javascript:window.open ....
var remove_event_popups = "true"; // <a href="#" onclick="window.open ....
var remove_target_popups = "true"; // <a .... target="_blank"
var remove_script_popups = "true"; // all "in-page" script pop-ups - MAY BREAK LINK
var nullify_all = "true"; // nullifies open in all scripts (external too) - MAY BREAK LINK
var form_targets = "true"; // for <form .. target="_blank"
/* END OF PREFERENCE OPTIONS */
 
var allLinks, thisLink, L_att_vals, L_attr;
var allScriptTags, target_string;
var allForms, thisForm, F_att_vals, F_attr;
 
var expression = /(.)*(window\.open\([\'|\"])(https?\:\/\/)?(www\.)?([-_A-Z0-9\/\.]+[^#|?|\'|\"|\s])*/gi;
 
allLinks = document.evaluate(
      '//a',
      document,
      null,
      XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
      null
      );
  for (var i = 0; i < allLinks.snapshotLength; i++)
  {
    thisLink = allLinks.snapshotItem(i);
    L_att_vals = thisLink.attributes;
    for (var j = 0; j < L_att_vals.length; j++)
    {
      L_attr = L_att_vals[j].value;
        if((L_att_vals[j].name == "href") && L_attr.match(expression) && (remove_href_popups == "true"))
      {
        thisLink.setAttribute("href", RegExp.$3 + RegExp.$4 + RegExp.$5);
      }
        if((L_att_vals[j].name != "href") && L_attr.match(expression) && (remove_event_popups == "true"))
      {
        thisLink.setAttribute("href", RegExp.$3 + RegExp.$4 + RegExp.$5);
        thisLink.setAttribute(L_att_vals[j].name, "");
      }
        if((L_att_vals[j].name == "target") && L_attr.match(/_blank/gi) && (remove_target_popups == "true"))
      {
        thisLink.setAttribute(L_att_vals[j].name, "_self");
      }
 
    }
  }
 
if(remove_script_popups == "true")
{
allScriptTags = document.evaluate(
      '//script',
      document,
      null,
      XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
      null
      );
  for (var k = 0; k < allScriptTags.snapshotLength; k++)
  {
    target_string = allScriptTags.snapshotItem(k).innerHTML;
    if(target_string.match(/window\.open/gi))
    {  
      target_string = target_string.replace(/window\.open/gi, "");  
      var new_script_tag = document.createElement('script');
      new_script_tag.setAttribute("type","text/javascript");
      new_script_tag.innerHTML = target_string;
      document.body.appendChild(new_script_tag);
    }
  }
}
 
if(nullify_all == "true")
{
  var nulling_script_tag = document.createElement('script');
  nulling_script_tag.setAttribute("type","text/javascript");
  nulling_script_tag.innerHTML = "open = null;"
  document.body.appendChild(nulling_script_tag);
}
 
if(form_targets == "true")
{
allForms = document.evaluate(
      '//form',
      document,
      null,
      XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,
      null
      );
  for (var m = 0; m < allForms.snapshotLength; m++)
  {
    thisForm = allForms.snapshotItem(m);
    F_att_vals = thisForm.attributes;
    for (var n = 0; n < F_att_vals.length; n++)
    {
      F_attr = F_att_vals[n].value;
      if((F_att_vals[n].name == "target") && F_attr.match(/_blank/gi))
      {
        thisForm.setAttribute(F_att_vals[n].name, "_self");
      }
    }
  }
}
 
})();
nopopuplinks.user.js
About - Blog - Sitemap - Contact - Forums - Home 

PHP icon. PEAR icon. MySQL icon. phpBB icon. Sitepoint icon. Valid XHTML 1.0 icon. Valid CSS! icon. Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0