Advertisement
Guest User

Untitled

a guest
Jul 1st, 2014
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name BlockIt, Its like NoScript extension for firefox, but different.
  3. // @author shoust
  4. // @version 1.5
  5. // @description  Best way is to describe the extension for firefox, basically NoScript is an extension for firefox that allows selective blocking/unblocking of scripts in the page, this does the same , but more, it allows blocking/unblocking of iframes,embedded content and images as well, plus by default, it keeps elements that are based on the site unblocked, so only things not based on the site are blocked.
  6. // @include *
  7. // ==/UserScript==
  8.  
  9. (function() {
  10.     if (location.hash != '#nsoff' && !window.name.match(/#nsoff/) && !location.href.match(/\.(svgz?|jpe?g|js|txt|png|gif|bmp|css)$/)) {
  11.         /*Check if the script needs to be executed. */
  12.      var cornerposition = 4;
  13.     // 1 = top left, 2=top right , 3=bottom left , 4=bottom right etc, makes the button to show the options in either the top or bottom of the page.
  14.     var blocksiteresources = false;
  15.     // This option allows blocking of all the scripts based on the site, if false, resources residing on http://my.opera.com on http://my.opera.com/community/ won't be blocked for example.
  16.     var imgblockIt = true;
  17.     var iframeblockIt = true;
  18.     var mediablockIt = true;
  19.         function createCookie(name, value, days, addition, forpage)
  20.         /* for saving the settings to cookies. The "addition" variable is to add settings to the cookie, instead of removing the whole cookie altogether*/
  21.         {
  22.             if (!forpage)
  23.             /*Saving settings for the page/pathname only,instead of the whole site*/
  24.             {
  25.                 var x = escape(location.pathname);
  26.                 x = x.replace(/\//g, '__').replace(/\./g, '--');
  27.             }
  28.             if (name != 'noresource') name = 'no' + activeselect();
  29.             if (days) {
  30.                 var date = new Date();
  31.                 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
  32.                 var expires = "; expires=" + date.toGMTString();
  33.             } else
  34.             var expires = "";
  35.             document.cookie = name + (!forpage ? x: '') + "=" + value + (addition ? ' ' + addition: '') + expires + "; path=/";
  36.         }
  37.         function readCookie(name, forpage)
  38.         /*For reading the settings*/
  39.         {
  40.             if (!forpage)
  41.             /*Reading settings for the page/pathname only,instead of the whole site*/
  42.             {
  43.                 var x = escape(location.pathname);
  44.                 x = x.replace(/\//g, '__').replace(/\./g, '--');
  45.             }
  46.             var nameEQ = (forpage == 'g' ? name: name + x) + "=";
  47.             var ca = document.cookie.split(';');
  48.             for (
  49.             var i = 0; i < ca.length; i++) {
  50.                 var c = ca[i];
  51.                 while (c.charAt(0) == ' ')
  52.                 c = c.substring(1, c.length);
  53.                 if (c.indexOf(nameEQ) == 0)
  54.                 return c.substring(nameEQ.length, c.length);
  55.             }
  56.             return '';
  57.         }
  58.  
  59.         function eraseCookie(name) {
  60.             createCookie(name + activeselect(), "", -1);
  61.         }
  62.         // for deleting settings
  63.  
  64.         /* To work out what elements are being selected to block at the right time*/
  65.         function activeselect() {
  66.             var x = document.getElementById('ujs42-_noelementselect');
  67.             return (x ? x[x.selectedIndex].value: 'script');
  68.         }
  69.  
  70.         /* Function to generate the element block list for the Iframes, embeds and images in the page. */
  71.         function generatelist(name) {
  72.             var elementz = document.selectNodes('//' + name + '[@src]');
  73.             if (!elementz.length) {
  74.                 //if no elements on page, do nothing else.
  75.                 return;
  76.             }
  77.             var count = elementz.length;
  78.             var forpage = readCookie('no' + name) ? readCookie('no' + name) : '';
  79.             //settings for the page
  80.             var forsite = readCookie('no' + name, 'g') ? readCookie('no' + name, 'g') : '';
  81.             //settings for the site
  82.             var forserverunblock = readCookie('noresource', 'g') ? readCookie('noresource', 'g') : '';
  83.             var listselect = document.createElement('select');
  84.             //The list of elements and their urls to block
  85.             listselect.onchange = blocktoggle;
  86.             listselect.id = "ujs42-_no" + name + "select";
  87.             listselect.style = 'width:300px;display:none;margin-right:20px !important;';
  88.             var host = location.hostname;
  89.             for (
  90.             var i = elementz.length - 1; i >= 0, element = elementz[i]; i--) {
  91.                 var link = document.createElement('a');
  92.                 //just a way to get the hostname without using match or indexof.
  93.                 link.href = (element.src ? element.src: element.getAttribute('src'));
  94.                 var linkhost = link.hostname;
  95.                 elemcount = i + 's';
  96.                 // unique identifier in the document's order to block the element or unblock the element.
  97.                 var listoption = document.createElement('option');
  98.                 listoption.value = elemcount;
  99.                 listoption.innerText = (element.src ? element.src: element.getAttribute('src'));
  100.                 listoption.setAttribute('title', linkhost);
  101.                 //unique server identifier to block or unblock from this server
  102.                 listoption.setAttribute('alt', element.currentStyle.display);
  103.                 if (!blocksiteresources && linkhost == host) {
  104.                     count--;
  105.                     // to not display elements from the same site if blocksiteresources are off.
  106.                 }
  107.                 else if (link.href.indexOf('data:') == 0) {
  108.                     count--;
  109.                     // to not display elements starting with data:
  110.                 }
  111.                 else if ((forpage && forpage.indexOf(elemcount.toString()) != -1) || (forsite && forsite.indexOf(linkhost) != -1) || (forserverunblock && forserverunblock.indexOf(linkhost) != -1)) {
  112.                     // to unblock elements if they match the cookie that says to unblock them
  113.                     showasblocked_unblocked(listoption);
  114.                     listselect.appendChild(listoption);
  115.                 }
  116.                 else {
  117.                     //blocks the element.
  118.                     element.style.display = 'none';
  119.                     showasblocked_unblocked(listoption, 'X');
  120.                     listselect.appendChild(listoption);
  121.                 }
  122.  
  123.             }
  124.             if (count != 0)
  125.             {
  126.                 //if the elements that are needed to be blocked is zero, don't display option to block that list of elements.
  127.                 var elemselect = document.createElement('option');
  128.                 elemselect.innerText = (name == 'img' ? 'Images': name == 'embed' ? 'Embeds(Media)': name == 'iframe' ? 'Iframes': '') + '(' + count + ',' + elementz.length + ')';
  129.                 elemselect.value = name;
  130.                 return [elemselect,listselect];
  131.             }
  132.         }
  133.  
  134.         function showelementlist() {
  135.             //this function is to toggle between the element lists to block and unblock
  136.             var elemlist = ['img', 'embed', 'iframe', 'script'];
  137.             var element = this.value;
  138.             var elemselect = document.getElementById('ujs42-_no' + element + 'select');
  139.             for (
  140.             var i = elemlist.length - 1; i >= 0, elemtag = elemlist[i]; i--)
  141.  
  142.             if (elemtag == element) {
  143.                 elemselect.style.display = 'inline';
  144.             } else
  145.             if (document.getElementById('ujs42-_no' + elemtag + 'select')) {
  146.                 document.getElementById('ujs42-_no' + elemtag + 'select').style.display = 'none';
  147.             }
  148.             if (elemselect && elemselect.disabled == false)
  149.             blocktoggle();
  150.         }
  151.  
  152.         function showasblocked_unblocked(element, block, bringback, single) {
  153.             //function to show if an element is blocked or unblocked in the UI.
  154.             var notblocked = (element.innerText.indexOf('#X# -') == 0);
  155.            
  156.             var noscriptelement = document.getElementById('ujs42-_noscriptselect');
  157.             if (!notblocked && block == 'X') {
  158.                 if ((noscriptelement && noscriptelement.style.display == 'none') || !noscriptelement && single) {
  159.                     var highlight = document.selectSingleNode('//*[@src="' + element.innerText + '"]');
  160. if(highlight)                    {highlight.style.outlineColor = 'red';
  161.                     highlight.style.outlineStyle = 'dashed';
  162.                     setTimeout(function() {
  163.                         highlight.style.outlineStyle = 'none';
  164.                         highlight.style.display = 'none';
  165.                     },
  166.                     500);
  167.                 }}
  168.                 element.innerText = '#X# -' + element.innerText;
  169.             } else
  170.             if (notblocked && !block) {
  171.                 element.innerText = element.innerText.substr(5);
  172.                 if ((noscriptelement && noscriptelement.style.display == 'none') || !noscriptelement && single) {
  173.                     var highlight = document.selectSingleNode('//*[@src="' + element.innerText + '"]');
  174.                     if(highlight){highlight.style.display = element.getAttribute('alt');
  175.                     highlight.style.outlineColor = 'orange';
  176.                     highlight.style.outlineStyle = 'dashed';
  177.                     setTimeout(function() {
  178.                         highlight.style.outlineStyle = 'none';
  179.                     },
  180.                     500);
  181.                     if (single == '1') {
  182.                         highlight.scrollIntoView(true);
  183.                     }}
  184.                 }
  185.             }
  186.             if (bringback) {
  187.                 return element
  188.             }
  189.         }
  190.  
  191.         function block_unblock() {
  192.             //the function to write the stuff needed to unblock to cookie.
  193.             var optionelement = document.getElementById('ujs42-_no' + activeselect() + 'select');
  194.             var whattoblock = (event.ctrlKey || this.value == 'Server') ? optionelement[optionelement.selectedIndex].getAttribute('title') : (event.shiftKey || this.value == 'All') ? '': optionelement.value;
  195.             var unblockonly = event.altKey;
  196.             var whatservertounblock = (event.ctrlKey && this.value == 'Server');
  197.             var forpage = readCookie('no' + activeselect()) ? readCookie('no' + activeselect()) : '';
  198.             //for the page only, doesn't affect other pages on the same site
  199.             var forsite = readCookie('no' + activeselect(), 'g') ? readCookie('no' + activeselect(), 'g') : '';
  200.             //for the whole site, mainly to unblock servers.
  201.             var forserverunblock = readCookie('noresource', 'g') ? readCookie('noresource', 'g') : '';
  202.             if (document.getElementById('ujs42-_nelbb').value == 'Block') {
  203.                 //if it is in block mode, blocks the element.
  204.                 if (whattoblock != '' && whattoblock.match(/^\d{1,3}s/)) {
  205.                     //blocks the single element only
  206.                     showasblocked_unblocked(optionelement[optionelement.selectedIndex], 'X', false, '1');
  207.                     forpage = forpage.replace(whattoblock, '');
  208.                     if(!unblockonly)createCookie('no', forpage, ((forsite == '' && forpage == '') ? -1: 365));
  209.                 } else
  210.                 if (whattoblock == '') {
  211.                     //blocks all elements.
  212.                     eraseCookie('no' + activeselect());
  213.                     for (
  214.                     var i = optionelement.length - 1; i >= 0, x = optionelement[i]; i--) {
  215.                         showasblocked_unblocked(x, 'X',false,'2');
  216.                     }
  217.                 } else {
  218.                     if (!whatservertounblock) {
  219.                         // blocks server only.
  220.                         for (
  221.                         var i = optionelement.length - 1; i >= 0, x = optionelement[i]; i--) {
  222.                             if (whattoblock.indexOf(x.title) != -1) {
  223.                                 showasblocked_unblocked(x, 'X',false,'2');
  224.                             }
  225.                         }
  226.                         forsite = forsite.replace(whattoblock, '');
  227.                         if(!unblockonly)createCookie('no', forsite, ((forsite == '' && forpage == '') ? -1: 365), null, 'g');
  228.                     }
  229.                     else {
  230.                         //blocks server for all resources available.
  231.                         var elemlist = ['ujs42-_noimgselect', 'ujs42-_noembedselect', 'ujs42-_noiframeselect', 'ujs42-_noscriptselect'];
  232.                         for (var elemlistx = elemlist.length - 1; elemlistx >= 0, elemlisth = elemlist[elemlistx]; elemlistx--) {
  233.                             if (!document.getElementById(elemlisth)) {
  234.                                 continue;
  235.                             }
  236.                             else {
  237.                                 optionelement = document.getElementById(elemlisth);
  238.                             }
  239.                             for (
  240.                             var i = optionelement.length - 1; i >= 0, x = optionelement[i]; i--) {
  241.                                 if (whattoblock.indexOf(x.title) != -1) {
  242.                                     showasblocked_unblocked(x, 'X', false, '2');
  243.                                 }
  244.                             }
  245.                         }
  246.                         forserverunblock = forserverunblock.replace(whattoblock, '');
  247.                         if(!unblockonly)createCookie('noresource', forserverunblock, (forserverunblock == '' ? -1: 365), null, 'g');
  248.                     }
  249.  
  250.                 }
  251.             } else {
  252.                 if (whattoblock != '' && whattoblock.match(/^\d{1,3}s/)) {
  253.                     //unblocks single element only
  254.                     showasblocked_unblocked(optionelement[optionelement.selectedIndex], false, false, '1');
  255.                     if(!unblockonly)createCookie('no', whattoblock, 365, forpage);
  256.                 } else
  257.                 if (whattoblock == '') {
  258.                     //unblocks all elements.
  259.                     var rt = [];
  260.                     for (
  261.                     var i = optionelement.length - 1; i >= 0, g = optionelement[i]; i--) {
  262.                         var z = i + 's';
  263.                         if (forpage.indexOf(z) == -1) {
  264.                             showasblocked_unblocked(g,false,false,'2');
  265.                             rt[rt.length] = z;
  266.                         }
  267.                     }
  268.  
  269.                     if(!unblockonly)createCookie('no', rt.toString().replace(/\,/g, ' '), 365, forpage);
  270.                 }
  271.                 else {
  272.                     if (!whatservertounblock) {
  273.                         //unblocks server only.
  274.                         for (
  275.                         var i = optionelement.length - 1; i >= 0, x = optionelement[i]; i--) {
  276.                             if (whattoblock.indexOf(x.title) != -1) {
  277.                                 showasblocked_unblocked(x,false,false,'2');
  278.                             }
  279.                         }
  280.                         if(!unblockonly)createCookie('no', whattoblock, 365, forsite, 'g');
  281.                     }
  282.                     else {
  283.                         //unblocks server for all resources available.
  284.                         var elemlist = ['ujs42-_noimgselect', 'ujs42-_noembedselect', 'ujs42-_noiframeselect', 'ujs42-_noscriptselect'];
  285.                         for (var elemlistx = elemlist.length - 1; elemlistx >= 0, elemlisth = elemlist[elemlistx]; elemlistx--) {
  286.                             if (!document.getElementById(elemlisth)) {
  287.                                 continue;
  288.                             }
  289.                             else {
  290.                                 optionelement = document.getElementById(elemlisth);
  291.                             }
  292.                             for (
  293.                             var i = optionelement.length - 1; i >= 0, x = optionelement[i]; i--) {
  294.                                 if (whattoblock.indexOf(x.title) != -1) {
  295.                                     showasblocked_unblocked(x, false, false, '2');
  296.                                 }
  297.                             }
  298.                         }
  299.                         if(!unblockonly)createCookie('noresource', whattoblock, 365, forserverunblock, 'g');
  300.                     }
  301.                 }
  302.             }
  303.             blocktoggle();
  304.         }
  305.  
  306.         function blocktoggle() {
  307.             //toggles the block button to unblock and vice versa.
  308.             var a = document.getElementById('ujs42-_nelbb');
  309.             var b = document.getElementById('ujs42-_no' + activeselect() + 'select');
  310.             if (b[b.selectedIndex].innerText.indexOf('#X# -') == 0) {
  311.                 a.value = 'Unblock';
  312.             } else {
  313.                 a.value = 'Block';
  314.             }
  315.         }
  316.  
  317.  
  318.         var scriptcount = 0;
  319.         var scripturls = [];
  320.         opera.addEventListener('BeforeExternalScript',
  321.         function(e) {
  322.             if (e.element.tagName != 'SCRIPT') {
  323.                 //not a script? Do nothing else
  324.                 return
  325.             }
  326.             var scriptsource = e.element.src;
  327.             var forpage = readCookie('noscript');
  328.             var forsite = readCookie('noscript', 'g');
  329.             var forserverunblock = readCookie('noresource', 'g');
  330.             var link = document.createElement('a');
  331.             //same way to get hostname without needing to match
  332.             link.href = scriptsource;
  333.             var linkhost = link.hostname;
  334.             scriptnumber = scriptcount + 's';
  335.             //unique identifier for script order in the document.
  336.             var scriptoption = document.createElement('option');
  337.             scriptoption.value = scriptnumber;
  338.             scriptoption.innerText = scriptsource;
  339.             scriptoption.setAttribute('title', linkhost);
  340.             if (!blocksiteresources && linkhost.indexOf(location.hostname) != -1) {
  341.                 //do nothing if blocksiteresources is off.
  342.                 }
  343.             else if ((forpage && forpage.indexOf(scriptnumber.toString()) != -1) || (forsite && forsite.indexOf(linkhost) != -1) || (forserverunblock && forserverunblock.indexOf(linkhost) != -1))
  344.             {
  345.                 //if cookie contains and "unblocks" make sure its added.
  346.                 scripturls.push(scriptoption);
  347.             }
  348.             else {
  349.                 //block scripts if the cookie tells them its not blocked.
  350.                 e.preventDefault();
  351.                 scripturls.push(showasblocked_unblocked(scriptoption, 'X', 'h'));
  352.             }
  353.             scriptcount++;
  354.         },
  355.         false);
  356.         document.addEventListener('DOMContentLoaded',
  357.         function() {
  358.             var userinterface = document.createElement('ujs42-_noresource');
  359.             userinterface.style = 'position:fixed;' + (cornerposition < 3 ? 'top': 'bottom') + ':1px;' + (cornerposition % 2 == 1 ? 'left': 'right') + ':1px;width:20px;height:20px;background:-o-skin("Browser Window Skin");white-space:nowrap;z-index:9999;direction:ltr;border:1px solid black;';
  360.             userinterface.id = 'ujs42-_noresourceinterface';
  361.             //the interface for unblocking resources and blocking them
  362.             var uibackground = document.createElement('ujs42-_noresourceui');
  363.             //holds most of the UI elements, and centers them whenever possible
  364.             uibackground.id = 'ujs42-_noiframeui';
  365.             uibackground.style.display = 'none';
  366.             uibackground.style.textAlign = 'center';
  367.             var elementselection = document.createElement('select');
  368.             //To select what list of elements to block.
  369.             elementselection.id = "ujs42-_noelementselect";
  370.             elementselection.onchange = showelementlist;
  371.             elementselection.style.width = 'auto !important';
  372.             elementselection.style.marginLeft = '20px !important';
  373.             uibackground.appendChild(elementselection);
  374.             var noscriptlist = document.createElement('select');
  375.             //For listing all the scripts in the page, that are needed to be blocked
  376.             noscriptlist.onchange = blocktoggle;
  377.             noscriptlist.id = "ujs42-_noscriptselect";
  378.             noscriptlist.style = 'width:300px;margin-right:20px !important;';
  379.             if (scripturls.length) {
  380.                 //start to add the scripts.
  381.                 var scriptscounter = document.createElement('option');
  382.                 scriptscounter.innerText = 'Scripts' + '(' + scripturls.length + ',' + scriptcount + ')';
  383.                 //adds scripts counter to be blocked/unblocked, plus total number.
  384.                 scriptscounter.value = 'script';
  385.                 elementselection.appendChild(scriptscounter);
  386.                 for (
  387.                 var i = scripturls.length - 1; i > -1; i--) {
  388.                     noscriptlist.appendChild(scripturls[i]);
  389.                 }
  390.                 uibackground.appendChild(noscriptlist);
  391.             }
  392.             //no scripts here? Don't add.
  393.             if(imgblockIt){var x=generatelist('img');
  394.             if(x){elementselection.appendChild(x[0]);uibackground.appendChild(x[1]);}}//to add all the other resource lists, if wished.
  395.             if(iframeblockIt){var x=generatelist('iframe');
  396.             if(x){elementselection.appendChild(x[0]);uibackground.appendChild(x[1]);}}
  397.             if(mediablockIt){var x=generatelist('embed');
  398.             if(x){elementselection.appendChild(x[0]);uibackground.appendChild(x[1]);}}
  399.                         if (elementselection.innerHTML != '') { //no point carrying on if there aren't any resources to be unblocked.
  400. var unblockselected = document.createElement('input');
  401.             unblockselected.type = 'button';
  402.             unblockselected.id = 'ujs42-_nelbb';
  403.             unblockselected.value = 'Block';
  404.             //button to block individual resources.
  405.             unblockselected.onclick = block_unblock;
  406.             uibackground.appendChild(unblockselected);
  407.             var unblockall = document.createElement('input');
  408.             unblockall.type = 'button';
  409.             unblockall.value = 'All';
  410.             //button to block all resources.
  411.             unblockall.onclick = block_unblock;
  412.             uibackground.appendChild(unblockall);
  413.             var tempunblock = document.createElement('input');
  414.             tempunblock.type = 'button';
  415.             tempunblock.value = 'T-unblock';
  416.             //unblocks all for tab only.
  417.             tempunblock.title = 'Temporarily unblocks resources for tab,WARNING: page will reload, shift click for this webpage only. To turn resource blocking back on, either remove #nsoff from url and hit enter or close tab and re-open it.';
  418.             tempunblock.onclick = function(e) {
  419.                 if (e.shiftKey) location.hash = '#nsoff';
  420.                 else window.name = window.name + '#nsoff';
  421.                 history.go(0);
  422.             };
  423.             uibackground.appendChild(tempunblock);
  424.             var unblockserver = document.createElement('input');
  425.             unblockserver.type = 'button';
  426.             unblockserver.id = 'ujs42-_nelser';
  427.             unblockserver.value = 'Server';
  428.             //unblocks according to server address.
  429.             unblockserver.onclick = block_unblock;
  430.             uibackground.appendChild(unblockserver);
  431.             var previewresource = document.createElement('input');
  432.             previewresource.type = 'button';
  433.             previewresource.id = 'ujs42-_resourcepreview'
  434.             previewresource.value = 'Preview';
  435.             //previews resource in new tab.
  436.             previewresource.onclick = function() {
  437.                 var selectedelementindex = document.getElementById('ujs42-_no' + activeselect() + 'select').selectedIndex;
  438.                 var elementoption = document.getElementById('ujs42-_no' + activeselect() + 'select')[selectedelementindex].innerText;
  439.                 if (elementoption.indexOf('#X# -') == 0) {
  440.                     window.open(elementoption.substr(5))
  441.                 } else window.open(elementoption)
  442.             };
  443.             uibackground.appendChild(previewresource);
  444.             var showui = document.createElement('input');
  445.             showui.type = 'button';
  446.             showui.style = 'width:20px;height:20px;background:-o-skin("Panel Links");display:inline-block;position:absolute;' + (cornerposition < 3 ? 'top': 'bottom') + ':0px;' + (cornerposition % 2 == 1 ? 'left': 'right') + ':0px;';
  447.             //button always on to show the interface.
  448.             showui.onclick = function() {
  449.                 if (uibackground.style.display == 'none') {
  450.                     uibackground.style.display = 'inline-block';
  451.                     userinterface.style.width = 'auto';
  452.                     userinterface.style.height = 'auto';
  453.                     if (document.getElementById('ujs42-_no' + activeselect() + 'select').disabled == false) {
  454.                         blocktoggle();
  455.                     }
  456.                 } else {
  457.                     uibackground.style.display = 'none';
  458.                     userinterface.style.width = '20px';
  459.                     userinterface.style.height = '20px';
  460.                 }
  461.             }
  462.             userinterface.appendChild(uibackground);
  463.             userinterface.appendChild(showui);
  464.             document.documentElement.appendChild(userinterface);
  465.             var linebreak = document.createElement('br');
  466.             uibackground.insertBefore(linebreak, unblockselected);
  467. if (!document.getElementById('ujs42-_noscriptselect')) {
  468.                 elementselection.onchange();
  469.             }
  470.             var stylesheet = document.createElement('style');
  471.             stylesheet.innerText = '#ujs42-_noresourceinterface *{font-family:sans-serif !important}#ujs42-_noresourceinterface input[type=button],#ujs42-_noresourceinterface select{border:2px outset black !important;margin:0px !important;}#ujs42-_noresourceinterface input[type=button]:active{outline:2px inset black !important;border:0px !important;}#ujs42-_noiframeui input[type=button]{background-color:#e0e0e0 !important;margin-right:4px !important}#ujs42-_noresourceinterface select{background-color:white !important;}@media screen and (max-width: 1200px) {#ujs42-_noiframeui *{font-size:10pt !important;}#ujs42-_noscriptselect,#ujs42-_noimgselect,#ujs42-_noiframeselect,#ujs42-_noembedselect{width:300px !important}}@media screen and (max-width: 800px) {#ujs42-_noiframeui *{font-size:8pt !important;}#ujs42-_noscriptselect,#ujs42-_noimgselect,#ujs42-_noiframeselect,#ujs42-_noembedselect{width:200px !important}} @media screen and (max-width: 500px) {#ujs42-_noiframeui *{font-size:6pt !important;}#ujs42-_noscriptselect,#ujs42-_noimgselect,#ujs42-_noiframeselect,#ujs42-_noembedselect{width:150px !important} #ujs42-_noiframeui input[type=button]{margin-right:0px !important}#ujs42-_resourcepreview,#ujs42-_nelbb{padding-left:0px !important;padding-right:0px !important}}@media screen and (max-width: 270px){#ujs42-_noiframeui{display:inline-block;}#ujs42-_noresourceinterface{width:100% !important;height:auto !important;content:"BlockIt can\'t be viewed at this width";white-space:normal !important;text-align:center;}}';
  472.             //interesting bit here, this is mainly for the script to work with most or all screen sizes, it checks the width and resizes accordingly, while keeping the main toggle button out of the way
  473.             document.documentElement.appendChild(stylesheet);
  474.         }},
  475.         false);
  476.     }
  477. })
  478. ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement