解决在Firefox下面Live Space“发布日志”按钮被禁用的问题

来源:互联网 发布:天猫隐形眼镜 知乎 编辑:程序博客网 时间:2024/05/17 08:49
来自主blog。

不知道从什么时候起,我的Live Space在Firefox下面使用就开始不正常了,“发布日志”的按钮一直都是灰色的。
为了解决这个问题,分析了一下Live Space发布的页面,用greasemonkey把这个问题解决了,将其分享给大家。

首先,你需要安装Firefox扩展 greasemonkey。这个扩展可以使你在加载一个页面的时候执行一段你自己的Javascript程序。

安装之后,将下面的程序拷贝到一个文本文件,并把扩展名改成 .user.js
(务必是.user.js,否则greasemonkey无法自动安装之)。

===脚本开始,拷贝时请不要包含这一行===
// ==UserScript==
// @name           Enable Live Space Post Button
// @namespace      http://ftofficer.spaces.live.com
// @description    Enable Live Space Post Button
// @include        http://*.spaces.live.com/*
// ==/UserScript==

function LiveSpace_enableButton(id) {
  var button = document.getElementById(id);
  if ( button ) {
    var cls = button.getAttribute("class");
    var clsNameEnd = cls.indexOf("spDisabled");
    if ( clsNameEnd != -1 ) {
      clsNameEnd--;   // skip " " before spDisabled
      var newCls = cls.substring(0, clsNameEnd);
     
      button.setAttribute("class", newCls);
      button.setAttribute("mi:state", "enabled");

      var aNode = document.createElement("a");
      aNode.id = id;
      aNode.href = "#";
    }
  }
}

LiveSpace_enableButton("actionToolbarBlogPost");
LiveSpace_enableButton("actionToolbarSave");

===脚本结束,拷贝时请不要包含这一行===

然后将这个js文件拖放到Firefox窗口中,greasemonkey会弹出对话框询问是否安装,选择是,即可完成安装。

然后,去Live Space的“添加日志”当中看看吧。

  • 如果看到“发布日志”和“保存为草稿”仍然没有启用的话,请看看greasemonkey当中配置的网直通配符是不是和你的网址一致,自己改改看看。在不行可以在这里回复。
原创粉丝点击