| 
					阅读:4367回复:10
				 [已解决]无法关闭新浪微博Social API
					不知道什么时候启用了,莫名其妙就发现多了一个新浪图标,就像膏药贴一样没法去掉 Mac OS X Aurora 22.0a2 在附加组件-services里面remove没有效果 每次重启浏览器后about:config就出现以下内容,即使手动reset后也是如此 social.activeProviders;{"http://m.weibo.cn":1}
social.manifest.weibo;{"origin":"http://m.weibo.cn","name":"Weibo", "workerURL":"http://m.weibo.cn/js/social/worker.js", "iconURL": "http://weibo.com/favicon.ico", "sidebarURL":"http://m.weibo.cn/sidebar/"} | |
| 1楼#发布于:2013-04-24 01:34 Re: 求助,无法关闭新浪微博Social API到配置文件夹里面的pref.js,删除上述字段。 参考: <!-- l --><a class="postlink-local" href="https://www.firefox.net.cn/forum/viewtopic.php?p=324127#p324127">viewtopic.php?p=324127#p324127</a><!-- l --> | |
| 
 | 
| 2楼#发布于:2013-04-24 01:34 Re: 求助,无法关闭新浪微博Social API那个帖子看了,prefs.js有那两条内容,关闭Aurora后,删掉那两条保存,重启Aurora后会自动还原   user_pref("social.activeProviders", "{\"http://m.weibo.cn\":1}");
user_pref("social.manifest.weibo", "{\"origin\":\"http://m.weibo.cn\",\"name\":\"Weibo\", \"workerURL\":\"http://m.weibo.cn/js/social/worker.js\", \"iconURL\": \"http://weibo.com/favicon.ico\", \"sidebarURL\":\"http://m.weibo.cn/sidebar/\"}");我再找找是不是有别的东东在修改 | |
| 3楼#发布于:2013-04-24 01:34 Re: 求助,无法关闭新浪微博Social API /Users/XXXX/Library/Application Support/Firefox/Profiles/XXXXXXXX.default/extensions/cpmanager@mozillaonline.com/improve/content/socialapi/overlay-browser.js 在这里找到一个文件,js无法上传,直接贴文件内容吧 (function() {
  var jsm = {};
  try {
    Cu.import("resource://gre/modules/SocialService.jsm", jsm);
  } catch(e) {}
  var SocialAPIHack = {
    lastEventReceived: 0,
    _prefs: null,
    _weibo: {
      iconURL: 'http://weibo.com/favicon.ico',
      name: 'Weibo',
      origin: 'http://m.weibo.cn',
      sidebarURL: 'http://m.weibo.cn/sidebar/',
      workerURL: 'http://m.weibo.cn/js/social/worker.js'
    },
    _ensureWeibo: function SocialAPIHack___ensureWeibo(weibo) {
      jsm.SocialService.getProvider(weibo.origin, function(existedProvider) {
        let prefBranch = gPrefService.getBranch('social.manifest.');
        if (!existedProvider) {
          prefBranch.setCharPref('weibo', JSON.stringify(weibo));
          jsm.SocialService.addProvider(weibo, function() {});
        } else {
          prefBranch.clearUserPref('facebook');
        }
      });
    },
    handleEvent: function SocialAPIHack__handleEvent(aEvent) {
      switch (aEvent.type) {
        case "load":
          this.init();
          break;
        case "ActivateSocialFeature-Weibo":
          this.activateWeibo(aEvent);
          break;
      }
    },
    init: function SocialAPIHack__init(){
      this._prefs = gPrefService.getBranch('extensions.cmimprove.socialapi.');
      if (!(window.Social && Social.activateFromOrigin)) {
        return
      }
      var self = this;
      // Social.provider may not be inited quickly enough
      setTimeout(function() {
        self._ensureWeibo(self._weibo);
        gBrowser.addEventListener("ActivateSocialFeature-Weibo", SocialAPIHack, true, true);
      }, 1000);
    },
    activateWeibo: function SocialAPIHack__activateWeibo(e){
      // from browser/base/content/browser-social.js
      let targetDoc = e.target;
      if (!(targetDoc instanceof HTMLDocument)) {
        return;
      }
      if (targetDoc.defaultView.top != content) {
        return;
      }
      let activateOrigin = targetDoc.nodePrincipal.origin;
      let whitelist = this._prefs.getCharPref('whitelist');
      if (whitelist.split(',').indexOf(activateOrigin) == -1) {
        return;
      }
      if (window.PrivateBrowsingUtils && PrivateBrowsingUtils.isWindowPrivate &&
          PrivateBrowsingUtils.isWindowPrivate(window)) {
        return;
      }
      let now = Date.now();
      if (now - SocialAPIHack.lastEventReceived < 1000) {
        return;
      }
      SocialAPIHack.lastEventReceived = now;
      let oldOrigin = Social.provider ? Social.provider.origin : "";
      let provider = Social.activateFromOrigin(this._weibo.origin);
      if (!provider) {
        return;
      }
      let description = document.getElementById("social-activation-message");
      let brandShortName = document.getElementById("bundle_brand").getString("brandShortName");
      let message = gNavigatorBundle.getFormattedString("social.activated.description",
                                                        [provider.name, brandShortName]);
      description.value = message;
      let notificationPanel = SocialUI.notificationPanel;
      notificationPanel.setAttribute("origin", provider.origin);
      notificationPanel.setAttribute("oldorigin", oldOrigin);
      notificationPanel.hidden = false;
      setTimeout(function () {
        notificationPanel.openPopup(SocialToolbar.button, "bottomcenter topright");
      }, 0);
    },
  }
  window.addEventListener('load', SocialAPIHack, false);
})();查看目录下的install.rdf,发现那个组件是火狐中国的附加组件管理器,奇怪了,什么时候装了这个东东,一直用的是英文版的Aurora <?xml version="1.0"?>
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:em="http://www.mozilla.org/2004/em-rdf#">
	<Description about="urn:mozilla:install-manifest">
		<em:id>cpmanager@mozillaonline.com</em:id>
		<em:version>0.6.23</em:version>
		<em:name>Addons Manager</em:name>
		<em:description>To manage the addons package in Firefox.</em:description>
		<em:creator>Mozilla Online Limited</em:creator>
		<em:contributor>Conchshell</em:contributor>
		<em:contributor>Ray Cheung</em:contributor>
		<em:contributor>Xuan Xie</em:contributor>
		<em:contributor>Jiao Feng</em:contributor>
		<em:homepageURL>http://www.firefox.com.cn/</em:homepageURL>
		<em:optionsURL>chrome://cmsafeflag/content/options.xul</em:optionsURL>
		<em:unpack>true</em:unpack>
		<em:targetApplication>
			<Description>
				<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
				<em:minVersion>3.0a1</em:minVersion>
				<em:maxVersion>21.*</em:maxVersion>
			</Description>
		</em:targetApplication>
		
		<em:updateURL>http://g-fox.cn/chinaedition/addons/cpmanager/update.rdf?version=%ITEM_VERSION%</em:updateURL>
		<em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2zWwTHIR23xreMABqMJXj1YrFowjiaBieTNqC2bE9PImSaMBxmYqrQ/UryquunGB0LJVE6tzzdioK9KFp+8ZO4eZL0fpxA9I+8mp+g3MTwqMVZD5ma3qwEGDngATaJwlcWY5xmrWcWNUgogP7n6JYuw0Giuc7crDNK3n1/nCbhwIDAQAB</em:updateKey>
		<em:localized>
			<Description>
				<em:locale>zh-CN</em:locale>
				<em:name>附加组件管理器</em:name>
				<em:description>用来管理火狐的附加组件系统。</em:description>
				<em:creator>Mozilla Online Limited</em:creator>
				<em:homepageURL>http://www.firefox.com.cn/</em:homepageURL>
			</Description>
		</em:localized>
				
	</Description>
</RDF>禁用该扩展后就没有出现反弹的现象了,问题解决 | |
| 4楼#发布于:2013-04-24 01:34 
					不得不说,谋智的这个扩展的名字本身就非常具有迷惑性,而且这种做法非常不厚道				 | |
| 5楼#发布于:2013-04-24 01:34 
					中标了。。。。。。。。。。所以我只用官方版。				 | |
| 
 | 
| 6楼#发布于:2013-04-24 01:34 
					可能之前有一次误删Aurora,恢复配置文件过程中安装了Firefox,也许是这样混合了,之前的配置文件应该没问题,郁闷 平时都是比较小心,从来下的都是英文官网的版本 | |
| 7楼#发布于:2013-04-24 01:34 
					老实说,火狐中文版只适合刚使用的新手,因为它加了一些有中国特色的扩展,这些扩展对于这些新手来说也基本上很适合,这种部署方式有助于快速推广。而对于老鸟,或爱折腾的,建议还是使用官方原版+自己安装扩展,毕竟两个版本所装扩展有可能会冲突。 仅代表个人意见,无任何倾向。   | |
| 
 | 
| 8楼#发布于:2013-04-24 01:34 
					之间看博文,firefox总部目前给firefox中国目前的任务是建立生态圈,所以首先得积累人气 在这个贡献了世界90%以上IE6用户的神奇国度,或许普通的推广部署手段不太好用…… | |
| 
 | 
| 9楼#发布于:2013-04-24 01:34 
					现在在FF 22的正式版中安装中国版的“附加组件管理器”扩展还是同样存在这个问题。同意4楼的观点,每次about:config中social.manifest.weibo选项的值都会被该扩展重新赋值,很烦啊。现在我只能将weibo{.....}中的参数全部删除,这样对social.manifest.weibo的赋值就成为“{}”了,还是没有彻底解决问题,我也尝试过移除文件overlay-browser.js,但是无效,不知道又从哪里冒出一个东东对social.manifest.weibo赋值为iconurl............,哪位高手有时间可以指教一下啊。我有心里洁癖,看见这个花括号就是不爽,嘿嘿嘿…… 另外,不知道是否可以使用userChrome解决啊 | |
| 10楼#发布于:2013-04-24 01:34 
					中国版还会把默认搜索引擎改成百度,在集成的扩展里做的,有点流氓				 | |
| 
 | 
 
							
 
				


 
				



 
				
 
				
