之前开启硬解一直有CPU占用高,或者无法启用的问题,有的即使启用了但在全屏切换时会有卡顿,偶尔看到一个GM脚本叫“Force Flash Wmode”,把Flash的参数Wmode设置为gpu或者direct可以强制开启硬解。使用之后果然上述出现的问题不见了。
GM脚本地址:
https://greasyfork.org/en/scripts/5433-force-flash-wmode
不过这个脚本有两个问题,一是只对object对象处理,但有些flash用的是embed;二是只处理找到的第一个object,如果有多个就无法处理。
下面是针对上面两个问题修改后的代码:
var wmode = "gpu"; //direct or gpu
var targetNode=document.body;
var matchObject="object[type='application/x-shockwave-flash']";
var matchEmbed="embed[type='application/x-shockwave-flash']";
var onMatch=function(node){
var objs = document.querySelectorAll(matchObject);
var embs = document.querySelectorAll(matchEmbed);
if (objs) {
for (i = 0; i < objs.length; i++) {
var wmodeParam=objs[i].querySelector("param[name='wmode']");
if(wmodeParam){
wmodeParam.value= wmode;
} else {
var param = document.createElement("param");
param.setAttribute("name", "wmode");
param.setAttribute("value", wmode);
objs[i].appendChild(param);
}
}
}
if (embs) {
for (i = 0; i < embs.length; i++) {
embs[i].setAttribute("wmode", wmode);
}
}
return true;
};
var MutationObserver=window.MutationObserver;
var observer = new MutationObserver(function(mutations) {
mutations.some(function(mutation){
var addedNodes=Array.from(mutation.addedNodes||[]);
return addedNodes.some(function(node){
if(node.nodeType!==Node.ELEMENT_NODE)return;
if(!node.mozMatchesSelector(matchObject) && !node.mozMatchesSelector(matchEmbed))return;
return onMatch(node);
});
});
});
var options={childList: true, subtree: true};
observer.observe(targetNode, options);
2015年2月12日星期四
Firefox用NPSWF32.dll无法播放Flash、出现白屏
2016-08-05 Update: 只要新建一个文本文件,名字为mms.cfg,复制如下内容:
RTMFPP2PDisable=1
ProtectedMode=0
AutoUpdateDisable=1
AVHardwareDisable=1
SilentAutoupdateEnable=0
保存后放入 Macromed\Flash目录,64位和32位的都放一份好了,重开firefox就好了
————————————————————————————————————
最近有两台机器先后出现Firefox无法播放flash,用的是单文件的NPSWF32.dll,经过排查,
一台机器是别人为了在IE播放flash而安装了adoble flash player for IE;另一台是安装的Window 10,自带IE的flash player。处理方式也很简单,先去控制面板卸载Flash,然后进入WinPE(有双系统的进入另一个也可以),然后找到刚才系统所在的分区,
32位系统的话进入\Windows\System32\Macromed\Flash,64位系统进入\Windows\SysWOW64\Macromed\Flash,删除里面的全部文件即可。
RTMFPP2PDisable=1
ProtectedMode=0
AutoUpdateDisable=1
AVHardwareDisable=1
SilentAutoupdateEnable=0
保存后放入 Macromed\Flash目录,64位和32位的都放一份好了,重开firefox就好了
————————————————————————————————————
最近有两台机器先后出现Firefox无法播放flash,用的是单文件的NPSWF32.dll,经过排查,
一台机器是别人为了在IE播放flash而安装了adoble flash player for IE;另一台是安装的Window 10,自带IE的flash player。处理方式也很简单,先去控制面板卸载Flash,然后进入WinPE(有双系统的进入另一个也可以),然后找到刚才系统所在的分区,
32位系统的话进入\Windows\System32\Macromed\Flash,64位系统进入\Windows\SysWOW64\Macromed\Flash,删除里面的全部文件即可。
2014年3月20日星期四
Firefox 28使用noscript扩展会影响greasemonkey的脚本
FF28开始,如果用noscript或者其他方法禁止了页面的JS,那么GM脚本里用到的
addEventListener这个方法都会失效。
2013年11月28日星期四
关于firefox修改omni.ja记住密码
之前修改firefox目录下omni.ja\components\nsLoginManager.js的_isAutoCompleteDisabled方法,不过FF26开始好像找不到了,然后解包了omni.ja全文件查找了一下,发现这个方法在modules\LoginManagerContent.jsm,不知道修改了这个文件有没有用?
2013年2月27日星期三
win7补丁KB2670838与firefox硬件加速冲突
手贱更新了一个windows的补丁KB2670838,这个好像是跟directx有关的,导致firefox在打开硬件加速的情况下有些文本模糊发虚,卸载这个补丁就恢复正常了。
如果要装IE10就需要这个补丁,因为包含了directx11.1的东西。所以可以在firefox菜单选项高级里面禁用硬件加速。
在网上看到的另一个解决方法:firefox的about:config里找到gfx.content.azure.backends,设为cairo也可以解决问题。
如果要装IE10就需要这个补丁,因为包含了directx11.1的东西。所以可以在firefox菜单选项高级里面禁用硬件加速。
在网上看到的另一个解决方法:firefox的about:config里找到gfx.content.azure.backends,设为cairo也可以解决问题。
2013年1月16日星期三
关于firefox Cache bug的补充
之前说过一个firefox cache的bug,现在找到了问题所在,在about:config中有下面两个参数:
privacy.sanitize.sanitizeOnShutdown
privacy.clearOnShutdown.cache
如果都设置为true的话,那么缓存其实根本就没工作,可以通过about:cache查到,里面只有Memory cache和Offline cache,而正常情况应该还有一个Disk cache,临时的解决办法就是上面两个中的一个设为false或者两个都为false。
至少到firefox 18这个版本问题依旧。
privacy.sanitize.sanitizeOnShutdown
privacy.clearOnShutdown.cache
如果都设置为true的话,那么缓存其实根本就没工作,可以通过about:cache查到,里面只有Memory cache和Offline cache,而正常情况应该还有一个Disk cache,临时的解决办法就是上面两个中的一个设为false或者两个都为false。
至少到firefox 18这个版本问题依旧。
2012年5月15日星期二
2012年3月13日星期二
userChrome.js导致firefox工具栏图标变大
今天突然发现firefox的工具栏图标变大了,试了很多方法都没效,最后发现是userchrome.js惹得祸,只要使用了uc.xul的脚本就会把图标撑大,而用uc.js的脚本就没这个问题,解决方法要么不用uc.xul文件,要么改写成uc.js,幸好改起来没那么困难。
2012年2月21日星期二
常用的User-Agent
Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.8.1.6) Gecko/20070914 Firefox/2.0.0.7
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
Mozilla/5.0 (Windows; U; Windows NT 6.0; en) AppleWebKit/522.15.5 (KHTML, like Gecko) Version/3.0.3 Safari/522.15.5
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/103u (KHTML, like Gecko) safari/100
Opera/9.23 (X11; Linux x86_64; U; en)
Opera/9.23 (Windows NT 5.1; U; en)
Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)
Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0)
Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
查看浏览器User-Agent的网站,http://whatsmyuseragent.com/
firefox设置UA:
地址栏输入“about:config”,找到“general.useragent.override”,如果没有这一项,则点右键“新建”->“字符串,设置上面的值。
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
Mozilla/5.0 (Windows; U; Windows NT 6.0; en) AppleWebKit/522.15.5 (KHTML, like Gecko) Version/3.0.3 Safari/522.15.5
Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/103u (KHTML, like Gecko) safari/100
Opera/9.23 (X11; Linux x86_64; U; en)
Opera/9.23 (Windows NT 5.1; U; en)
Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)
Mozilla/5.0 (Windows; U; MSIE 7.0; Windows NT 6.0)
Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10
查看浏览器User-Agent的网站,http://whatsmyuseragent.com/
firefox设置UA:
地址栏输入“about:config”,找到“general.useragent.override”,如果没有这一项,则点右键“新建”->“字符串,设置上面的值。
2012年2月19日星期日
Greasemonkey 脚本应用在本地文件的办法
引用自:http://www.firefox.net.cn/forum/viewtopic.php?t=31181
最近的更新中,GreaseMonkey 脚本再也不能用在本地的文件上了,也就是说,什么文本链接化、自动高亮、划词翻译等等等等的 GM脚本,对另存到本地的网页、电子书的 HTML 页面、甚至 Scrapbook 保存下来的网摘等等等等都无效了。
经过一轮“翻山越岭做好汉”,我终于找到了讨论此问题的几乎唯一的帖子:
| 引用: |
| On Wed, Dec 30, 2009 at 1:00 AM, Matt Sargent <matt.sarg...@earthlink.net wrote: Until a recent release, Greasemonkey could run on locally stored HTML pages. This was very handy, especially when combined with the Scrapbook add-on. Does anyone know of a way to restore this behavior to a script? >>> On 12/29/2009 7:06 PM, esquifit wrote: Since a couple of releases there are two new 'hidden' preferences: greasemonkey.aboutIsGreaseable greasemonkey.fileIsGreaseable The default value is "false". If you want Greasemonkey to run on file:/// urls, you have to set the second one to "true" (in about:config). >>> On Fri, Jan 1, 2010 at 7:49 AM, Matt Sargent <matt.sarg...@earthlink.net wrote: THANK YOU!! This was exactly what I was looking for. It works perfectly. |
也就是说,把 about:config 里面“greasemonkey.fileIsGreaseable”值改为“true”就可以让 GM脚本 对本地文件生效了。
但是:
| 引用: |
| esquifit Fri, 01 Jan 2010 02:39:49 -0800 Glad to know. Keep in mind, however, that this implies a security risk. A malicious userscript could open a tab or a frame, load a "file:" url from your local drive into it, read the contents and send them to any server. Even binary files could be stolen in this way, including files stored in your Firefox profile containing sensitive information (passwords, cookies, history, etc). In order to know the exact location of the profile folder the attacker could either do a recursive scan of your hard disk (directory contents can also be listed via file: urls) until it reached the profile.ini file in which all profile directories are listed, or it could open the about:cache page and read the profile from there, provided access to about: urls is granted via the "greasemonkey.aboutIsGreaseable" preference. This security risk was in fact the motivation for the new preferences, as far as I can remember. This was handled in bug #1000: http://github.com/greasemonkey/greasemonkey/issues/closed#issue/1000 |
也就是说,这样做是有风险的,对于恶意的 GM脚本 来说就是开了一个盗取你的隐私的大门。
这个其实也不是解决不了的,方法就是打开上述键值之后,对于确认安全的而且需要对本地文件生效的 GM脚本,通过 GreaseMonkey 的脚本管理将“file:///*”加入到其允许规则中,对于信不过的脚本则把同样的规则加入到其除外规则中。在安装脚本的时候注意,要是有脚本的对所有 网页生效(允许规则为“*”),就要在安装后马上将其允许规则修改(例如改成“http://”)或者在除外规则中加入“file:///*”以作预防。
firefox Cache Bug?
几次碰到页面的图片没法载入,直接找到图片地址打开还是说“未找到文件”,试着用安全模式还是不行,想想跟扩展、插件的应该没关系,备份profile后重做了一个,好了;开始一堆设置,想想应该都是保存在prefs.js这个文件里的,回去刚才的profile里把prefs.js删了,果然也好了;遂开始一项项排除,终于发现在设了browser.cache.disk.parent_directory这个cache目录后出问题,进入firefox的选项->高级->网络,发现缓存满了,清楚缓存,一切恢复正常。
不知道这个是不是firefox缓存管理的一个bug,在缓存设到别的目录然后满了就不知道怎么做了。
不知道这个是不是firefox缓存管理的一个bug,在缓存设到别的目录然后满了就不知道怎么做了。
2012年2月7日星期二
foxyproxy的用法
foxyproxy的用法: 原文:http://www.xzcblog.com/2012/02/7/%E7%9F%A5%E8%AF%866.html
因为autoproxy会导致我的火狐经常崩溃所以我把他换成了foxyproxy,这里我来介绍一下foxyproxy的用法。
凡是使用过autoproxy的同学都知道也许autoproxy不是最好用的但是他绝对是最方便的,因为她有一个订阅规则,只要订阅了他,就不需要我们自己手动添加代理规则了,foxyproxy没有规则列表但是我们同样可以使用autoproxy的规则。
首先选择工作模式为使用基于预定模块的代理服务器,
添加代理服务器:
在选项-》代理服务器选项中点击新建代理服务器,代理名称随便下面的颜色随便选一个,只要不合默认的一样即可。

代理服务器细节中点击手动配置代理服务器,因为使用的是ssh代理,所以主机选项添127.0.0.1 端口添7070并勾选下面的socks代理,选中socks v5

点击url模式,
点击确定。
点击模式订阅,点击下面的go,会弹出添加模式订阅的窗口其中订阅名称,订阅描述随便添,订阅网址填写https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt 代理服务器中添加我们之前创建的代理服务器,更新频率随你便,format选成autoproxy,obfuscation选成base64,点击确定即 可。

最后启用快速添加即可。
因为autoproxy会导致我的火狐经常崩溃所以我把他换成了foxyproxy,这里我来介绍一下foxyproxy的用法。
凡是使用过autoproxy的同学都知道也许autoproxy不是最好用的但是他绝对是最方便的,因为她有一个订阅规则,只要订阅了他,就不需要我们自己手动添加代理规则了,foxyproxy没有规则列表但是我们同样可以使用autoproxy的规则。
首先选择工作模式为使用基于预定模块的代理服务器,
添加代理服务器:
在选项-》代理服务器选项中点击新建代理服务器,代理名称随便下面的颜色随便选一个,只要不合默认的一样即可。
代理服务器细节中点击手动配置代理服务器,因为使用的是ssh代理,所以主机选项添127.0.0.1 端口添7070并勾选下面的socks代理,选中socks v5
点击url模式,
点击确定。
点击模式订阅,点击下面的go,会弹出添加模式订阅的窗口其中订阅名称,订阅描述随便添,订阅网址填写https://autoproxy-gfwlist.googlecode.com/svn/trunk/gfwlist.txt 代理服务器中添加我们之前创建的代理服务器,更新频率随你便,format选成autoproxy,obfuscation选成base64,点击确定即 可。
最后启用快速添加即可。
翻越防火长城,你可以到达世界上的每一个角落。(Across the Great Firewall, you can reach every corner in the world.)翻墙利器赛风3下载地址: http://dld.bz/caonima326
,http://dld.bz/caonima745
,http://dld.bz/caonima745
2011年9月28日星期三
Firefox Chrome URLs
chrome://browser/content/browser.xul
chrome://global/content/alerts/alert.xul
chrome://browser/content/preferences/preferences.xul
Opens the Options window. In Firefox 1.0 use chrome://browser/content/pref/pref.xulchrome://browser/content/bookmarks/bookmarksPanel.xul
Opens a list of your bookmarks.chrome://browser/content/history/history-panel.xul
Opens a list of websites in your history.chrome://global/content/console.xul
Opens the Javascript console.chrome://mozapps/content/extensions/extensions.xul?type=extensions
Opens the Extensions window.chrome://mozapps/content/extensions/extensions.xul
Opens the Themes window.chrome://mozapps/content/profile/profileSelection.xul
Closes the current tab in Firefox; or the window if there is only one tab open.chrome://global/content/finddialog.xul
Opens the old Firefox "Find" dialog (non functional)chrome://global/content/printdialog.xul
Opens the Firefox Print dialog (non functional)chrome://global/content/filepicker.xul
Seems to open a Linux style file picker on Windows for me. Non functional on Windows.
订阅:
博文 (Atom)