在Firefox 30上调试Greasemonkey脚本
问题说明
我一直在为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.
正确答案
或者,如果您只想调试脚本,那么您可以使用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
-
YouTube API 不能在 iOS (iPhone/iPad) 工作,但在桌面浏览器工作正常?
it1352 07-30 -
iPhone,一张图像叠加到另一张图像上以创建要保存的新图像?(水印)
it1352 07-17 -
保持在后台运行的 iPhone 应用程序完全可操作
it1352 07-25 -
使用 iPhone 进行移动设备管理
it1352 07-23 -
在android同时打开手电筒和前置摄像头
it1352 09-28 -
扫描 NFC 标签时是否可以启动应用程序?
it1352 08-02 -
检查邮件是否发送成功
it1352 07-25 -
Android微调工具-删除当前选择
it1352 06-20 -
希伯来语的空格句子标记化错误
it1352 06-22 -
Android App 和三星 Galaxy S4 不兼容
it1352 07-20