mirror of
https://github.com/murdos/musicbrainz-userscripts
synced 2024-11-13 22:37:08 +00:00
bandcamp_importer: support bandcamp pages having their own domain
Currently, one has to add the domain to userscript preferences for pages provided by bandcamp but under another domain (ie. http://bearthemammoth.com/album/yamadori) This change makes the @include wider (it may match totally unrelated pages) and test for a bandcamp-specific object before doing anything.
This commit is contained in:
parent
38e732a3c4
commit
e2f318c128
1 changed files with 9 additions and 2 deletions
|
@ -5,8 +5,7 @@
|
|||
// @namespace http://userscripts.org/users/22504
|
||||
// @downloadURL https://raw.github.com/murdos/musicbrainz-userscripts/master/bandcamp_importer.user.js
|
||||
// @updateURL https://raw.github.com/murdos/musicbrainz-userscripts/master/bandcamp_importer.user.js
|
||||
// @include http*://*.bandcamp.com/album/*
|
||||
// @include http*://*.bandcamp.com/track/*
|
||||
// @include /^https?://[^/]+/(?:album|track)/[^/]+$/
|
||||
// @require https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js
|
||||
// @require lib/import_functions.js
|
||||
// @require lib/logger.js
|
||||
|
@ -209,6 +208,14 @@ var BandcampImport = {
|
|||
};
|
||||
|
||||
$(document).ready(function () {
|
||||
/* keep the following line as first, it is required to skip
|
||||
* pages which aren't actually a bandcamp page, since we support
|
||||
* bandcamp pages under third-party domains.
|
||||
* see @include
|
||||
*/
|
||||
if (!unsafeWindow.TralbumData) return;
|
||||
/***/
|
||||
|
||||
MBImportStyle();
|
||||
|
||||
var mblinks = new MBLinks('BCI_MBLINKS_CACHE');
|
||||
|
|
Loading…
Reference in a new issue