Skip to content

Commit

Permalink
userChromeJS_Mix 1.7.2 修正新窗口重新解析 uc 脚本出错的问题
Browse files Browse the repository at this point in the history
原因是解析时 userChromejs 可能不存在
  • Loading branch information
ywzhaiqi committed Sep 15, 2014
1 parent 648ae3b commit 5eb0844
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 10 deletions.
4 changes: 3 additions & 1 deletion userChromeJS_Mix.xpi/src/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
</div>
<div class="float head margin4">
<div>新一代 uc 脚本管理器</div>
<div class="version">v{{version}}</div>
<div class="version">
<a href="https://github.com/ywzhaiqi/userChromeJS/blob/master/userChromeJS_Mix.xpi/updateInfo.md">v{{version}}</a>
</div>
</div>
</a>
</div>
Expand Down
2 changes: 1 addition & 1 deletion userChromeJS_Mix.xpi/src/content/script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var app = angular.module('userChromejsApp', [], function ($compileProvider) {
});

app.controller('mainCtroller', function($scope){
$scope.version = '1.7.1';
$scope.version = '1.7.2';
$scope.activeTabIndex = 0;
$scope.tabs = ['已安装脚本', '实用程序', '在线网址'];

Expand Down
15 changes: 9 additions & 6 deletions userChromeJS_Mix.xpi/src/content/userChrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,10 @@
config = match.length > 0 ? match[1].replace(/^\s+/,"") : "";

var url = aFile && fph.getURLSpecFromFile(aFile),
filename = aFile && aFile.leafName,
filename = aFile && aFile.leafName || '',
regex = new RegExp("^" + exclude + "(" + (rex.include.join("|") || ".*") + ")$", "i"),
includeMain = regex.test(BROWSERCHROME);

var type = /\.uc(?:-\d+)?\.js$/i.test(filename) ? 'js' :
/\.uc(?:-\d+)?\.xul$/i.test(filename) ? 'xul' : '';

return {
filename: filename,
file: aFile,
Expand All @@ -413,10 +410,15 @@

// new added
id: id ? id : (name || filename) + '@' + (namespace || author || 'userChromejs'),
type: type,
get type() {
return /\.uc(?:-\d+)?\.js$/i.test(this.filename) ? 'js' :
/\.uc(?:-\d+)?\.xul$/i.test(this.filename) ? 'xul' : '';
},
homepageURL: homepageURL,
reviewURL: reviewURL,
downloadURL: downloadURL || userChromejs.store.get(filename, {}).installURL,
get downloadURL() {
return downloadURL || (userChromejs && userChromejs.store.get(filename, {}).installURL);
},
updateURL: updateURL,
optionsURL: optionsURL,
fullDescription: fullDescription,
Expand Down Expand Up @@ -658,6 +660,7 @@
if( !this.EXPERIMENT && true ){ //← uc.jsでのloadOverlayに対応
for(var m=0,len=this.overlays.length; m<len; m++){
overlay = this.overlays[m];
// 排除加载 rebuild_userChrome.uc.xul
if( overlay.filename == this.ALWAYSEXECUTE
|| !!this.dirDisable['*']
|| !!this.dirDisable[overlay.dir]
Expand Down
2 changes: 1 addition & 1 deletion userChromeJS_Mix.xpi/src/install.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>userChromeJS@mozdev.org</em:id>
<em:name>userChromeJS Mix</em:name>
<em:version>1.7.1</em:version>
<em:version>1.7.2</em:version>
<em:type>2</em:type>
<em:unpack>true</em:unpack>
<em:description></em:description>
Expand Down
2 changes: 1 addition & 1 deletion userChromeJS_Mix.xpi/update.rdf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RDF:Seq>
<RDF:li>
<RDF:Description>
<em:version>1.7.1</em:version>
<em:version>1.7.2</em:version>
<em:targetApplication>
<RDF:Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
Expand Down
4 changes: 4 additions & 0 deletions userChromeJS_Mix.xpi/updateInfo.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
更新日志
========

### 版本 1.7.2 2014-9-15

* 修正取消勾选 "使用脚本缓存" 时,新窗口解析 uc 脚本出错的问题。

### 版本 1.7.1 2014-9-13

* 更改路径为 local\userChromejs_mix.json,并可从 userChrome.FILE 中读取值
Expand Down
Binary file modified userChromeJS_Mix.xpi/userChromeJS_Mix.xpi
Binary file not shown.

0 comments on commit 5eb0844

Please sign in to comment.