File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
app/src/main/java/org/matrix/chromext/utils Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,9 @@ val invalidUserScriptUrls = mutableListOf<String>()
76
76
fun isUserScript (url : String? , path : String? = null): Boolean {
77
77
if (url == null ) return false
78
78
if (url.endsWith(" .user.js" ) ||
79
- (Chrome .isEdge && url.endsWith(" .js" ) && url.startsWith(" file://" ))) {
79
+ (Chrome .isEdge &&
80
+ url.endsWith(" .js" ) &&
81
+ (url.startsWith(" file://" ) || url.startsWith(" content://" )))) {
80
82
if (invalidUserScriptUrls.contains(url)) return false
81
83
invalidUserScriptDomains.forEach { if (url.startsWith(" https://" + it) == true ) return false }
82
84
return true
@@ -92,7 +94,7 @@ fun resolveContentUrl(url: String): String {
92
94
val nameIndex = cursor.getColumnIndex(OpenableColumns .DISPLAY_NAME )
93
95
val dataIndex = cursor.getColumnIndex(" _data" )
94
96
if (dataIndex != - 1 ) {
95
- return cursor.getString(dataIndex)
97
+ return cursor.getString(dataIndex) ? : cursor.getString(nameIndex)
96
98
} else {
97
99
return cursor.getString(nameIndex)
98
100
}
You can’t perform that action at this time.
0 commit comments