Mytubeelement被注入页面

时间:2014-11-26 22:11:58

标签: jquery d3.js

我正在创建一个使用d3.js可视化某些数据的页面。目前,我只使用d3.js和jquery,但是当我检查页面时,我会在页面中注入一些非常神秘的代码。代码是:

<mytubeelement id="myTubeRelayElementToPage" event="preferencesUpdated" data="{&quot;bundle&quot;:{&quot;label_delimitor&quot;:&quot;
 :&quot;,&quot;percentage&quot;:&quot;
 %&quot;,&quot;smart_buffer&quot;:&quot;
 Smart Buffer&quot;,&quot;start_playing_when_buffered&quot;:&quot;
 Start playing when buffered&quot;,&quot;sound&quot;:&quot;
 Sound&quot;,&quot;desktop_notification&quot;:&quot;
 Desktop Notification&quot;,&quot;continuation_on_next_line&quot;:&quot;
 -&quot;,&quot;loop&quot;:&quot;
 Loop&quot;,&quot;only_notify&quot;:&quot;
 Only Notify&quot;,&quot;estimated_time&quot;:&quot;
 Estimated Time&quot;,&quot;global_preferences&quot;:&quot;
 Global Preferences&quot;,&quot;no_notification_supported_on_your_browser&quot;:&quot;
 No notification style supported on your browser version&quot;,&quot;video_buffered&quot;:&quot;
 Video Buffered&quot;,&quot;buffered&quot;:&quot;
 Buffered&quot;,&quot;hyphen&quot;:&quot;
 -&quot;,&quot;buffered_message&quot;:&quot;
 The video has been buffered as requested and is ready to play.&quot;,&quot;not_supported&quot;:&quot;
 Not Supported&quot;,&quot;on&quot;:&quot;
 On&quot;,&quot;off&quot;:&quot;
 Off&quot;,&quot;click_to_enable_for_this_site&quot;:&quot;
 Click to enable for this site&quot;,&quot;desktop_notification_denied&quot;:&quot;
 You have denied permission for desktop notification for this site&quot;,&quot;notification_status_delimitor&quot;:&quot;
 ;&quot;,&quot;error&quot;:&quot;
 Error&quot;,&quot;adblock_interferance_message&quot;:&quot;
 Adblock (or similar extension) is known to interfere with SmartVideo. Please add this url to adblock whitelist.&quot;,&quot;calculating&quot;:&quot;
 Calculating&quot;,&quot;waiting&quot;:&quot;
 Waiting&quot;,&quot;will_start_buffering_when_initialized&quot;:&quot;
 Will start buffering when initialized&quot;,&quot;will_start_playing_when_initialized&quot;:&quot;
 Will start playing when initialized&quot;,&quot;completed&quot;:&quot;
 Completed&quot;,&quot;buffering_stalled&quot;:&quot;
 Buffering is stalled. Will stop.&quot;,&quot;stopped&quot;:&quot;
 Stopped&quot;,&quot;hr&quot;:&quot;
 Hr&quot;,&quot;min&quot;:&quot;
 Min&quot;,&quot;sec&quot;:&quot;
 Sec&quot;,&quot;any_moment&quot;:&quot;
 Any Moment&quot;,&quot;popup_donate_to&quot;:&quot;
 Donate to&quot;,&quot;extension_id&quot;:&quot;
 lnkdbjbjpnpjeciipoaflmpcddinpjjp&quot;},&quot;prefs&quot;:{&quot;desktopNotification&quot;:true,&quot;soundNotification&quot;:true,&quot;logLevel&quot;:0,&quot;allowPromotion&quot;:true,&quot;enable&quot;:true,&quot;loop&quot;:false,&quot;hidePopup&quot;:true,&quot;autoPlay&quot;:false,&quot;autoBuffer&quot;:false,&quot;autoPlayOnBuffer&quot;:false,&quot;autoPlayOnBufferPercentage&quot;:42,&quot;autoPlayOnSmartBuffer&quot;:true,&quot;quality&quot;:&quot;
 default&quot;,&quot;fshd&quot;:false,&quot;onlyNotification&quot;:false,&quot;enableFullScreen&quot;:true,&quot;saveBandwidth&quot;:false,&quot;hideAnnotations&quot;:false,&quot;turnOffPagedBuffering&quot;:false}}"></mytubeelement>

为了清晰起见,我添加了换行符,但在代码中它全部在一行上。有谁知道这是什么?搜索元素'mytubeelement'并没有告诉我任何事情。

我正在编写的代码只是一个简单的页面,使用d3绘制条形图。

var color = d3.scale.linear()
    .domain([0,4500,9000,13500,18000])
    .range(["red","orange", "yellow","green","blue"]);

var width = 600,
    height = 500;

var margin = {top: 20, right: 30, bottom: 100, left: 70};

var x = d3.time.scale().domain([minDate,maxDate]).range([0,width]);

var y = d3.scale.linear()
    .domain([0,18000])
    .range([height, 0]);

var xAxis = d3.svg.axis()
    .scale(x)
    .orient("bottom");

var yAxis  = d3.svg.axis()
    .scale(y)
    .orient("left");

var chart = d3.select(".chart")
    .attr("width", width + margin.left + margin.right)
    .attr("height", height + margin.top + margin.bottom)
    .append("g")
    .attr("transform", "translate(" + margin.left + "," + margin.top + ")");

chart.append("g")
    .attr("class","y axis")
    .call(yAxis);

chart.append("g")
    .attr("class", "x axis")
    .attr("transform", "translate(0," + height + ")")
    .call(xAxis)
    .selectAll("text")
    .style("text-anchor", "end")
    .attr("dx", "-.8em")
    .attr("dy", "-.55em")
    .attr("transform", "rotate(-90)" );

chart.append("text")
    .attr("class", "label")
    .attr("x",-200)
    .attr("y",-margin.left+15)
    .text("Steps")
    .attr("transform","rotate(-90)")

var barWidth = width / computedDataArray.length;


var bar = chart.selectAll("g")
    .data(computedDataArray)
    .enter().append("g")
    .attr("transform", function(d, j) { return "translate(" + ((j-15)*barWidth) + ",0)"; });

bar.append("rect")
    .attr("y", function(d) { return y(d.value); })
    .attr("height", function(d) { return height - y(d.value); })
    .attr("width", barWidth - 1)
.attr("fill", function(d) {return color(d.value);} );

4 个答案:

答案 0 :(得分:4)

您是否有任何机会安装某种类型的视频缓冲插件?

我注意到同样的事情(mytubelement被插入到代码中)我记得我安装的插件会将代码注入到我访问过的网页中。

如果你有任何视频缓冲插件,你会尝试禁用插件,看看是否能解决你的问题吗?

答案 1 :(得分:1)

这是因为名为SmartVideo For YouTube™的插件。我禁用了该插件,元素插入已经消失。

答案 2 :(得分:1)

您有一个名为&#34; SmartVideo For YouTube™&#34;它会自动将youtube元素添加到您的页面中......

答案 3 :(得分:0)

SmartVideo for Youtube Chrome扩展程序执行此操作。