I learned a new trick here using document.getElementById("bad-element-Id") 
to find a bad widget and have its parent nuke it. 

Here's the code which works on dpreview.com
var badWidget = document.getElementById('challengeWinnersWidget');
badWidget.parentNode.removeChild(badWidget);

There is a similar slider on the Amazon.com home page. When I delete THIS 
specific node, it destroys the slider. Clicking on the Amazon.com bookmark 
brings it back. When I get that element by ID and try to block it, nothing 
happens:

   <div id=   <div id="gw-desktop-herotator" class="a-section 
a-spacing-none gw-desktop-herotator-ready">u class="a-section 
a-spacing-none gw-desktop-herotator-ready">  <<<<<  RIGHT_CLICK_DELETE_NODE 
<==  disappears slider.

The Id is obviously: "gw-desktop-herotator".  Using the same technique as 
above, this Id is not blocked. I have also tried every specific Id listed 
in the HTML.

Also tried "#gw-desktop-herotator"  <<  Listed as "unique selector"  <<  
Also does not work as Unique ID to block

// ==UserScript==
// @name Background Change
// @namespace http://www.example.com/ juliet/
// @description Change the background colour of a page
// @include http://www.dpreview.com/*
// @include http://www.amazon.com/*
// @grant       none
// ==/UserScript== 

var badWidget = document.getElementById('challengeWinnersWidget');   <<  
WORKS!!!
//alert("badWidget = " + badWidget);
badWidget.parentNode.removeChild(badWidget);

//var badCaro = document.getElementById('.a-carousel-container');    <<  
FAILS 
//var badCaro = document.getElementById('a-carousel-container');    <<  
FAILS 
//var badCaro = document.getElementById('gw-ftGr-desktop-hero-1');    <<  
FAILS 
//var badCaro = document.getElementById('anonCarousel1');    <<  FAILS 
//var badCaro = document.getElementById('gw-desktop-herotator');    <<  
FAILS 
var badCaro = document.getElementById('#gw-desktop-herotator');    <<  
FAILS 
alert("badCaro = " + badCaro);
badCaro.parentNode.removeChild(badCaro);


===================================================

Below is the the entire HTML block with the magic line in 
BOLD/large/italic. Destroying this line with DELETE NODE WORKS IMMEDIATELY:
<div id="pageContent" class="a-section a-spacing-none">

    <div style="width:100%;">
 *       <div id="gw-desktop-herotator" class="a-section a-spacing-none 
gw-desktop-herotator-ready">*
            <div class="a-carousel-container a-carousel-display-single 
a-carousel-transition-slide gw-desktop-herotator a-carousel-initialized" 
style="height:300px;" data-a-class="desktop" 
data-a-display-strategy="single" 
data-a-carousel-options="{"maintain_state":false,"minimum_gutter_width":0,"name":"gat…op-layout.herotator","show_partial_next":false,"set_size":5}">
                <form class="a-carousel-state" method="get" 
action="#"></form>
                <div class="a-row a-carousel-controls a-carousel-row">
                    <div class="a-carousel-row-inner">
                        <div class="a-carousel-col a-carousel-center">
                            <div id="anonCarousel1" 
class="a-carousel-viewport" style="height: 300px;">
                                <ol class="a-carousel" role="list" 
aria-live="assertive" style="width: 5670px; transform: translateX(0px);">
                                    <li class="a-carousel-card" 
aria-posinset="1" aria-setsize="5" role="listitem" style="visibility: 
visible; width: 1134px; margin: 0px;">
                                        <div id="gw-ftGr-desktop-hero-1" 
class="gw-ftGr-desktop-hero">
                                            <style></style>
                                            <div 
id="image-map-ns_0FDBJMN7PTD2YXBF28D1_18152_" class="shogun-widget 
image-map gateway-desktop-map">
                                                <div 
class="cropped-image-map-size">
                                                    <div 
class="cropped-image-map-center-alignment">
                                                        <map 
name="map_0_image-map-ns_0FDBJMN7PTD2YXBF28D1_18152_"></map>
                                                        <span 
style="display:inline-block">
                                                            <img 
class="a-dynamic-image" width="1500px" height="300px" 
usemap="#map_0_image-map-ns_0FDBJMN7PTD2YXBF28D1_18152_" 
data-a-dynamic-image="{"http://g-ecx.images-amazon.com/images/G/01/kindle/merch/20…GW_black_friday_ASTON_4500x900._V319207763_.jpg":[900,4500]}";
 
title="Fire HD 7, Only $109" 
src="http://g-ecx.images-amazon.com/images/G/01/kindle/merch/2014…W_black_friday_ASTON_4500x900._UX1500_SX1500_V319207763_.jpg";
 
alt="Fire HD 7, Only $109"></img>
                                                        </span>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </li>
                                    <li class="a-carousel-card" 
aria-posinset="2" aria-setsize="5" role="listitem" style="width: 1134px; 
margin: 0px;"></li>
                                    <li class="a-carousel-card" 
aria-posinset="3" aria-setsize="5" role="listitem" style="width: 1134px; 
margin: 0px;"></li>
                                    <li class="a-carousel-card" 
aria-posinset="4" aria-setsize="5" role="listitem" style="width: 1134px; 
margin: 0px;"></li>
                                    <li class="a-carousel-card" 
aria-posinset="5" aria-setsize="5" role="listitem" style="width: 1134px; 
margin: 0px;"></li>

-- 
You received this message because you are subscribed to the Google Groups 
"greasemonkey-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/greasemonkey-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to