[PREVIEW] 3.1.0 - Release Candidate 1
Pre-release
Pre-release
·
126 commits
to develop
since this release
Important
This version is almost finished but may still contain a few bugs and inconsistencies.
It is highly recommended you fully remove the script and reinstall it once the update is released, as data integrity can't be guaranteed for preview versions.
Click to expand the changelog at the time of 0de089e
- New features:
- Add hotkeys to focus and clear the search bar on both pages (closes #145)
- Improve config menu
- Add a sidenav to toggle off all but one feature category (closes #140)
- Add feature groups with headers to logically group features together
- Add generic markdown sections to render the changelog and an about section
- Remove advanced mode flag from a lot of features since there's much more space now
- π΅ Show the track number in playlists (by @indierodo) (closes #117)
- π΅ Use an exponential scale for the volume slider (by @cryeprecision) (closes #157)
- Require double-pressing the number keys within a configurable time frame to skip to the associated timestamp (closes #152)
- π΅ Automatically close the activity check dialog
- π΅ Swap like and dislike buttons to match YT's layout
- π΅ In fullscreen, also hide the player bar on idle
- Changes and improvements:
- π΅ Overhaul thumbnail overlay to fix massive inconsistencies (closes #143)
- Fix album artwork being fetched with wrong parameters (closes #149)
- Allow manually toggling between thumbnail providers
- Cache resolved AM album artwork URLs similar to how lyrics URLs are currently cached
- π΅ Decouple volume slider step and scroll step (closes #102)
- π΅ Make the "improve links" feature also apply to all types of song list items
- Change some default feature values (if left unchanged):
initTimeout: from8to5seconds (because of the now faster init time)rememberSongTimeDuration: from60to180sec- π΅
thumbnailOverlayITunesImgRes: from1500to2000px frameSkipAmount: from0.0417to0.0166seconds (tbr idk how this happened)
- Migrate to CoreUtils v3.0.0
DataStores - Overhaul contributing.md (part 1)
- Overhaul translations
- Add typedoc documentation for
interface.tsand common dependencies
- π΅ Overhaul thumbnail overlay to fix massive inconsistencies (closes #143)
- Fixes:
- Fix share tracking parameter not being removed on YT
- Fix inconsistent auto-like button rendering (closes #120)
- Fix DataStores going out of sync across sessions (closes #162)
- Fix auto-like feature not resolving channel names properly (closes #156)
- π΅ Fix SyntaxError when no AM album artwork found (closes #146)
- Fix Error when clicking on a BytmDialog's exit button (closes #147)
- Fix config menu not closing on Esc press when other dialog over top was closed with Esc
- π΅ Fix list buttons not disappearing with the native buttons in song lists (closes #86)
- π΅ Fix anchor improvements feature on the search page (closes #99)
- π΅ Fix rounded border in fullscreen mode when using the ThemeSong extension
- Fix page scroll bar reappearing after BytmDialog opened over top of the config menu is closed
- Fix inline SVG logo not being swapped in when
watermarkEnabledis off (closes #161) - Fix number input constraints not being respected (closes #56)
Click to expand plugin and internal changes
(I did my best to order these by relevance for each section)- Plugin Changes:
(also refer to version 3.1.0's API docs)- Migration guide:
β οΈ The plugin sublicense agreement was updated to version 2 to clarify points which were worded poorly. Read the latest version here.β οΈ POT. BREAKING: Since BYTM now requires plugin intents to be set, make sure to add all intents required by the authenticated functions your plugin calls to thePluginDefobject'sintentsproperty (which can now also be an array instead of just a bitwise-or'ed number). Read below for a list of functions and their required intents.- If you use the
BytmDialog,ExImDialogorMarkdownDialogclasses directly, switch to the new authenticated functionsgetBytmDialog(),getExImDialog()andgetMarkdownDialog(). Direct access will continue to work until version 4.0.0, but to future-proof your plugin, switch to the new functions as soon as possible, and make sure to add theCreateModalDialogs(32) intent to your plugin definition'sintentsproperty. - If you were using
bytm:readyto reliably wait until all features are initialized, switch tobytm:allReadyinstead.
Thebytm:readyevent is still emitted, but it is now only guaranteed to be emitted when the DOM is loaded and all features have started to initialize. - All
NanoEmittersubclasses and the interface-exposedNanoEmitterclass reference now use CoreUtils' newNanoEmitterclass, which grants you access to the powerfulonMulti()method to listen to multiple events at once, with configurable behavior. - The
intentsprop can now be an array ofPluginIntentenum members.
- API Changes:
β οΈ POT. BREAKING: Plugins will no longer be able to call authenticated functions without the required intents.
Intents are now required to be set in the plugin definition object, though for now they will still all be granted and don't need to be explicitly allowed by the user once after installing yet.
The new intentFullAccess(512) grants all other intents, though you should only use it if your plugin truly requires all intents.
These are the intents that are now required for the respective functions:getFeatures()-ReadFeatureConfig(1) and optionallySeeHiddenConfigValues(4)saveFeatures()-WriteFeatureConfig(2)setLocale()-WriteTranslations(16)getBytmDialog()-CreateModalDialogs(32)getExImDialog()-CreateModalDialogs(32)getMarkdownDialog()-CreateModalDialogs(32)getAutoLikeData()-ReadAutoLikeData(64)saveAutoLikeData()-WriteAutoLikeData(128)getInternals()-InternalAccess(256)
- The dialog classes
BytmDialog,ExImDialogandMarkdownDialogshould now be gotten using the new authenticatedgetBytmDialog(),getExImDialog()andgetMarkdownDialog()functions, respectively.
Using the direct access will work until version 4.0.0, but it is recommended you switch to the new functions as soon as possible. - The
PluginDefobject'sintentsproperty can now be either an array ofPluginIntentvalues or a single number that is the bitwise OR of the intents. - Added a new broadcast system based on the BroadcastChannel API (name:
bytm-broadcast), used for inter-tab communication. Events are relayed via the site eventbytm:siteEvent:broadcast- seesrc/utils/broadcast.tsfor a list of events. - Auth tokens are now in the format of a UUIDv4 instead of a 16-character, 36-radix string.
registerPlugin()now also returns apermissionsobject with theintandarrayproperties, which contain all of the bitwise OR of the plugin's intents and an array of the intents that were actually granted to the plugin. Theintproperty can be used with CoreUtils'bitSetHas()function to check if specific intents were granted.- A URL to the plugin's changelog file can now be specified in the
PluginDefobject'shomepage.changelogproperty.
- API Additions:
- Added new intents
InternalAccess(256) (currently only used bygetInternals()) andFullAccess(512) (grants all intents). - Added new functions to the interface that allow for better interaction with the siteEvents system:
resourceAsString()- Returns a BYTM resource as a string, some of which are cached cross-session in GM storage for better performance.onSiteEvent()- Adds a site event listener.onceSiteEvent()- Adds a site event listener that is only called once and also returns a Promise for use with the async/await pattern.onMultiSiteEvents()- Adds a listener that triggers after one of, or all of the given site events are dispatched, either continuously or just once, with configurable behavior.- π
getBytmDialog()(requires intentCreateModalDialogs(32)) - Returns a reference to theBytmDialogclass, which can be used to create new generic dialog instances. - π
getExImDialog()(requires intentCreateModalDialogs(32)) - Returns a reference to theExImDialogclass, to export and import serializable data. - π
getMarkdownDialog()(requires intentCreateModalDialogs(32)) - Returns a reference to theMarkdownDialogclass, to render a markdown string in a modal dialog. - π
getInternals()(requires intentInternalAccess(256)) - returns some internal function and object references that can be used by core libraries and deeper reaching plugins.
- Added new events:
bytm:preInitPlugin(no arguments) - emitted at the earliest possible point in time, even before the DOM is loaded, to allow plugins to do any immediate but superficial initialization.bytm:allReady(no arguments) - emitted when all features have been initialized and the interface is fully ready to use.
This triggers much later thanbytm:ready, which is emitted when the DOM is loaded and all features are starting to initialize.
For the fastest response times, usebytm:featureInitializedfor every feature your code depends on.bytm:featureInitialized:id(no arguments) - emitted when a feature with the specified key has been initialized.
In TypeScript, use"bytm:featureInitialized:myFeatureKey" as "bytm:featureInitialized:id"to make the error go away.bytm:artworkCacheEntryAdded- emitted when an album artwork was added to the cache. Gets passed an object with the propertiesartist,albumandentry(object with the propsentry.url: string,entry.videoId: stringandentry.created: number).bytm:siteEvent:cfgMenuMounted(no arguments) - emitted when the config menu is invisibly mounted to the DOM (not opened yet, but modifiable).bytm:siteEvent:configHeaderSelected: (name: LooseUnion<FeatureCategory>)- emitted when a config header is selected in the config menu, with the name of the selected header. This is usually the feature category name, but can also be an info category name (currently just"about"and"changelog").bytm:siteEvent:voteLabelsAdded(no arguments) - emitted after the Return YouTube Dislike vote labels were added to the DOM.bytm:siteEvent:updateVolumeSliderLabel(no arguments) - emitted to make the volume slider label update its text content.
- Added SelectorObserver instance
searchPage, as the root observer for the YTM search page.
- Added new intents
- Migration guide:
- Internal Changes:
- Added
@antifeature trackingdirective, to indicate that services temporarily log IP addresses and the currently playing song. - Added
@sv443-network/coreutilsas a new core library, accessible on the BYTM API viaBYTM.CoreUtils. - Updated
@sv443-network/userutilsto v10.x.x to, among other things, fix two bugs related to the template literal placeholder format. This now allows specifying a single placeholder multiple times per translation string. - Switched from UserUtils v9 DataStores to CoreUtils v3 DataStores with tons of improvements, refactors and new features.
- Made
siteEventssystem use CoreUtils' improvedNanoEmitter, so it can now also be used to listen to multiple events using.onMulti(). - Moved
siteEventsinitialization to an earlier point, so that it is no longer initialized alongside features. It is now available to plugins at an earlier point in time, before any feature has started initializing, but still after plugin initialization is already done. - Made plugin-specific
events(returned byregisterPlugin()) use CoreUtils' newNanoEmitteras well. - Improved script performance by refactoring the feature initialization process. As an effect of this,
bytm:readywill now emit earlier and the new eventbytm:allReadywill emit much later, once all features have been initialized or the configured timeout has been reached. - Updated a boatload of translation values and translation keys. Open this page to find all changes.
- Some resources are now cached in GM storage, when using the internal function
resourceAsString()for even better feature init performance. - BYTM now targets ES2020, meaning browser versions from before 2020 will no longer be supported.
- Added new GM menu commands:
- These commands are now available by default:
- Reset the config to its default values
- Export all config data [WIP]
- Export all data, including caches [WIP]
- Import data from a previous export [WIP]
- Download a console log file to attach to a GitHub issue
- In advanced mode, you can also use these additional commands:
- Decompress all GM storage values and list them in the JS console
- List all raw GM storage values in the JS console
- Delete all GM storage values (full wipe of all the data BYTM has accumulated)
- Reset the version session counter
- List active SelectorObserver listeners in the JS console
- Compress a value
- Decompress a value
- Log the script's initialization timings to the JS console
- Toggle developer treatments (experiments that are not quite ready for production)
- These commands are now available by default:
- Removed
GM.getResourceUrl()entirely in favor of fetching resources from a CDN. - Arguments to the translation functions can now also be an object that map a placeholder key to a string value, e.g.
{ name: "John" }for a translation using the new placeholder syntax, e.g."Hello, ${name}!". - The functions
sanitizeArtists()andsanitizeSong()will now replace some common Unicode punctuation symbols with their ASCII counterparts (e.g.β->'). - Moved the
generalfeature category to the top of the config menu. - Wrapped feature config elements in a new container element with the ID
bytm-ftconf-category-${categoryName}to allow for the sidenav to disable all but one at a time. - Added ability to render custom info categories in the config menu. Their navigation headers will be aligned to the bottom, and they render arbitrary elements. They use the same general formatting as the new feature category containers, just with their own
categoryName(currently just"about"and"changelog"). - Added intent checking function
pluginHasPerms()tointerface.ts, which will now check forFullAccessor the given intents before allowing authenticated functions to be called. - Added CSS var
--bytm-menu-bg-highlight-2(hex, opacity 1) as a secondary level of highlight to--bytm-menu-bg-highlight. - Renamed CSS var
--bytm-dialog-height-maxto--bytm-dialog-target-height, but only for the config menu. All BytmDialogs will still use--bytm-dialog-height-max. - Improved number argument resolution of the functions in
src/utils/logging.ts(if the last argument is a number that exceeds the range of the enumLogLevel, it will not be interpreted as a log level anymore, but as a number to be logged). - Added dev menu option to print an initialization timing report to the console for debugging performance issues.
- Added changesets to improve versioning and changelog maintenance.
- Added