helloitszak / bandcamp_volume

A chrome extension to add a volume slider to Bandcamp.com's music player.
31 stars 6 forks source link

Plugin doesn't work on redirected bandcamp sites. #2

Open helloitszak opened 11 years ago

helloitszak commented 11 years ago

Apparently Bandcamp users can host their bandcamps on their own domains. The current plugin only has access to ://.bandcamp.com through a content script. Do some research and figure out how to better handle this

Example for redirected site: http://recordiaulliwgar.com/album/y-record-goch

dmland commented 9 years ago

I worked around this issue by loading your (excellent!) script via TamperMonkey (the Chrome equivalent of GreaseMonkey for Firefox, as if you needed me to tell you that), necessitating two small changes, because user scripts do not have access to the localstorage API:

// chrome.storage.local.set({"volume":newvol}) GM_setValue({"volume":newvol})

and

// chrome.storage.local.get("volume", function(items) { GM_getValue("volume", function(items) {

Using Tampermonkey allows me to specify additional redirected sites on which your (outstanding!) script can function. Since you've got a full-on extension going, you could possibly add a config screen where folks could add redirects that will function with the (wonderful!) extension.

helloitszak commented 9 years ago

I'm still trying to figure out how to do this well, since you need to predeclare which sites the script will have access on in the manifest file. That cannot be changed at runtime as far as I know.

An idea would be to run it everywhere and simply detect if it's bandcamp or not, but then I'd have to inject a script on every page and I really would rather not do that.

soapergem commented 7 years ago

I ran into this problem today... couldn't figure out why on earth the plugin had stopped working, until I looked at the URL and saw it was ryanlerman.com instead of bandcamp.com. Apparently Bandcamp is set up in a way that if you're using a custom domain, it completely disables the bandcamp.com version. So that means the plugin is broken for any artists using their own domains.

It does look like there's plenty in the HTML to detect whether it's bandcamp or not once you've got the script running, but as you pointed out, I don't think there's a way to do this without injecting it into every page.

helloitszak commented 6 years ago

So Chrome has a feature that makes this possible now. The user experience won't be the best for non bandcamp.com sites, as you'd have to manually run it each time, but it'd be better than nothing.

I'm in the process of a big code overhaul for this, clean up some messy stuff. So hopefully I can include this as part of the update.

half-duplex commented 4 years ago

Preferably optional, for user trust and possibly performance

PeterMinin commented 2 years ago

As a workaround, I found a hacky way to open a *.bandcamp.com version of a custom-domain site. If you have a coolband.com URL, change it to coolband.com/?fan_action_pane=login. Then it redirects you to coolband.bandcamp.com/?fan_action_pane=login, where this extension works. Note: if you're not logged in to Bandcamp, it will show a log in overlay, but you can just close it.