Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move pages selectors into metadata.json #136

Open
1 task done
dabreadman opened this issue Jan 11, 2022 · 1 comment
Open
1 task done

Move pages selectors into metadata.json #136

dabreadman opened this issue Jan 11, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@dabreadman
Copy link
Collaborator

Is your feature request related to a problem?

Seeing we have metadata.json for players, we could do the same for pages, which makes it easier for contribution and separation of concern.

Describe the solution you'd like

Have it structured as such,

getIdentifier(): string {
    return new Function(metadata.getIdentifier.arguments, metadata.getIdentier.body)()
  }

### Describe alternatives you've considered

_No response_

### Additional context

Example Metadata
```json
{
     "pageUrls": ["*://beta.crunchyroll.com/*"],
     "selectorStrings": {
         "default": { // do we even need this :?
            "getIdentifier":{
                  "arguments": "",
                  "body": "return window.location.pathname.split('/')[2]" // <- wonder if reference gonna be right :U
                                                                          // guess we could simply pass in the window object
                  }
            ...
         }
     }
}

Function serialization/deserialization
https://stackoverflow.com/questions/36517173/how-to-store-a-javascript-function-in-json

Code of Conduct

  • I agree to fill in the correct information
@dabreadman dabreadman added the enhancement New feature or request label Jan 11, 2022
@lexesj
Copy link
Member

lexesj commented Jan 11, 2022

Due to CSP issues this one might not be possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants