mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
need to access repo metadata through proper entry point
This commit is contained in:
parent
9b40ec937f
commit
6e08a3bf18
1 changed files with 14 additions and 11 deletions
25
js/assets.js
25
js/assets.js
|
|
@ -284,7 +284,7 @@ var getRepoMetadata = function(callback) {
|
|||
if ( checksumsChanged ) {
|
||||
updateLocalChecksums();
|
||||
}
|
||||
// Fetch and store homeURL associations
|
||||
// Notify all waiting callers
|
||||
while ( callback = repoMetadata.waiting.pop() ) {
|
||||
callback(repoMetadata);
|
||||
}
|
||||
|
|
@ -342,6 +342,19 @@ var getRepoMetadata = function(callback) {
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
exports.setHomeURL = function(path, homeURL) {
|
||||
var onRepoMetadataReady = function(metadata) {
|
||||
var entry = metadata.entries[path];
|
||||
if ( entry === undefined ) {
|
||||
entry = metadata.entries[path] = new AssetEntry();
|
||||
}
|
||||
entry.homeURL = homeURL;
|
||||
}
|
||||
getRepoMetadata(onRepoMetadataReady);
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
// Get a local asset, do not look-up repo or remote location if local asset
|
||||
// is not found.
|
||||
|
||||
|
|
@ -905,16 +918,6 @@ exports.metadata = function(callback) {
|
|||
|
||||
/******************************************************************************/
|
||||
|
||||
exports.setHomeURL = function(path, homeURL) {
|
||||
var entry = repoMetadata[path];
|
||||
if ( entry === undefined ) {
|
||||
entry = repoMetadata[path] = new AssetEntry();
|
||||
}
|
||||
entry.homeURL = homeURL;
|
||||
};
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
exports.purge = function(pattern, before) {
|
||||
cachedAssetsManager.remove(pattern, before);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue