use installation url on known sites as homepage
This commit is contained in:
parent
78b0e33ba4
commit
4913da2e19
|
@ -1,6 +1,6 @@
|
|||
/* eslint no-eq-null: 0, eqeqeq: [2, "smart"] */
|
||||
/* global createCache db calcStyleDigest db tryRegExp styleCodeEmpty styleSectionGlobal
|
||||
getStyleWithNoCode msg sync uuidv4 */
|
||||
getStyleWithNoCode msg sync uuidv4 URLS */
|
||||
/* exported styleManager */
|
||||
'use strict';
|
||||
|
||||
|
@ -226,6 +226,13 @@ const styleManager = (() => {
|
|||
if (!reason) {
|
||||
reason = style ? 'update' : 'install';
|
||||
}
|
||||
let url = !data.url && data.updateUrl;
|
||||
if (url) {
|
||||
const usoId = URLS.extractUsoArchiveId(url);
|
||||
url = usoId && `${URLS.usoArchive}?style=${usoId}` ||
|
||||
URLS.extractGreasyForkId(url) && url.match(/^.*?\/\d+/)[0];
|
||||
if (url) data.url = data.installationUrl = url;
|
||||
}
|
||||
// FIXME: update updateDate? what about usercss config?
|
||||
return calcStyleDigest(data)
|
||||
.then(digest => {
|
||||
|
|
|
@ -46,7 +46,7 @@ function createSourceEditor({style, onTitleChanged}) {
|
|||
metaCompiler.onUpdated(meta => {
|
||||
style.usercssData = meta;
|
||||
style.name = meta.name;
|
||||
style.url = meta.homepageURL;
|
||||
style.url = meta.homepageURL || style.installationUrl;
|
||||
updateMeta();
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user