• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

在Firefox 30上调试Greasemonkey脚本

用户头像
it1352
帮助1

问题说明

我一直在为Youtube开发一个使用Greasemonkey的JavaScript代码片段,并且还引入了Bootstrap和jQuery库。此应用程序必须为每个搜索列表结果添加一个按钮,用户点击该按钮时,必须将用户上传的视频从他的频道中移出。我已经测试了按钮,它在Firefox 29上运行良好。

I've been developing a JavaScript snippet for Youtube which uses Greasemonkey, and also imports Bootstrap and jQuery libraries. This application has to add a button for each one of the search list results and when the user clicks it, it must bring the user uploaded videos from his channel. I've tested the button and it works well on Firefox 29.

然而,最近我更新了Firefox到30版,现在我无法看到/调试我写的代码,尽管Firefox执行它。我想知道,如果有任何解决这个问题的解决方案?

Nevertheless, recently I updated Firefox to version 30, and now I'm unable to see/debug the code I wrote, although Firefox executes it. I'd like to know, if is there any solution to this issue?

如果你想看到,这里是代码:

Here is the code if you would like seeing it:

// ==UserScript==
// @name Requerimiento2-2-Guille.user.js
// @description   Rodrigo
// @include         http://www.youtube.com/*
// @include         https://www.youtube.com/*
// @grant           none
// ==/UserScript== 

/* Here it's the Bootstrap and jQuery code pasted (I know it should be done with an include).*/

var boton='<button    type="button" class="verVideos btn btn-lg yt-uix-button yt-uix-button-size-default yt-uix-button-primary">' '<span class="glyphicon glyphicon-list"></span>Ver videos del usuario' 
    '</button>';

    $(function(){
        iniciarScript();
    });
    function iniciarScript(){
        $("#search-results li.yt-lockup div.yt-lockup-content").before(boton);
        $("#verVideos").click(mostrarVideosUsr);
    }
    function mostrarVideosUsr(){        
        alert("Se pulso el boton!");
    }

PD:我已经尝试使用其他用户配置文件启动Firefox,但它保持不能正常工作。

PD: I've tried starting Firefox with other user profile, but it keeps not working.

正确答案

#1

或者,如果您只想调试脚本,那么您可以使用Chrome与 Tampermonkey

Or if you simply want to debug your script then you can use Chrome with Tampermonkey.

Tampermonkey与Greasemonkey几乎相同,所以如果你的脚本在Tampermonkey上工作,它应该工作在Greasemonkey上。

Tampermonkey works almost identical to Greasemonkey so if your script works on Tampermonkey it should work on Greasemonkey.

只要记住,如果从文件系统安装,那么您需要启用Tampermonkey的访问。请参阅FAQ中的视频,了解如何启用:
http://tampermonkey.net/faq。 php#Q204

Just remember that if install from file system then you need to enable access for Tampermonkey. See video in the FAQ on how to enable this: http://tampermonkey.net/faq.php#Q204

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /reply/detail/tanhbkjjjj
系列文章
更多 icon
同类精品
更多 icon
继续加载