-
Notifications
You must be signed in to change notification settings - Fork 37
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
Make profile overlay search accessible via URL options #388
Comments
Not sure how suitable our current code is for this but we already have some stuff to deal with hash parameters. We do have Modbar uses it to open the settings dialogue https://github.com/toolbox-team/reddit-moderator-toolbox/blob/master/extension/data/modules/modbar.js#L497-L530 (side note, that interval mechanism is a bit odd, we might at one point look at doing that in a different manner possibly hook it into the url change mechanism) |
Thinking about it, it would be great if we could work it into |
To continue my spam (I'll make this the last comment for now), it seems that if (window.location.hash) {
const hash = window.location.hash.substring(1);
// To make sure we only trigger on toolbox hashes we check that the first param starts with `tb`.
// This because `tbsettings` is already used for settings.
if(hash.startsWith('?tb')) {
const paramObject = {};
const params = hash.split('&');
params.forEach(param => {
const keyval = param.split('=');
const key = keyval[0].replace('?', ''),
val = keyval[1];
paramObject[key] = val;
});
window.dispatchEvent(new CustomEvent('TBHashParams', {detail: contextObject}));
}
} |
As the hashing mechanism is now implemented I figure I'd start work on this. Before I do however I want to properly work out the parameters used. So far I am thinking about the following
Do we also want a param for I also need to take the Finally in regards to the actual implementation I want to try to avoid adding too much mechanics to specifically make this possible. For example, when initiating search I am planning to input the given params into the actual search fields and submitting the form. However to tell |
* Basic intial hash param initiated user profile * Profile search through hash params * Update extension/data/modules/profile.js Co-authored-by: Geo <georgej1088@gmail.com> * Update extension/data/modules/profile.js Co-authored-by: Geo <georgej1088@gmail.com> Co-authored-by: Geo <georgej1088@gmail.com>
* Basic intial hash param initiated user profile * Profile search through hash params * Update extension/data/modules/profile.js Co-authored-by: Geo <georgej1088@gmail.com> * Update extension/data/modules/profile.js Co-authored-by: Geo <georgej1088@gmail.com> Co-authored-by: Geo <georgej1088@gmail.com>
Suggested here. We probably wouldn't want to use a proper query string for this, but doing something similar to the hash fragments RES adds when scrolling through NER pages could probably be doable.
The text was updated successfully, but these errors were encountered: