File tree Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Expand file tree Collapse file tree 3 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -2134,8 +2134,11 @@ export class InnerPlayer {
21342134 * Inform the user that the browser restored the file from the back/forward cache.
21352135 */
21362136 protected displayRestoredFromBfcacheMessage ( ) : void {
2137- // Do not display the message if another one is already shown.
2138- if ( this . container . querySelector ( "#message-overlay" ) !== null ) {
2137+ // Do not display the message if another one is already shown or website opted out.
2138+ if (
2139+ this . container . querySelector ( "#message-overlay" ) !== null ||
2140+ this . loadedConfig ?. hideRestoredMessage
2141+ ) {
21392142 return ;
21402143 }
21412144 const message = textAsParagraphs ( "message-restored-from-bfcache" ) ;
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const DEFAULT_CONFIG: Required<BaseLoadOptions> = {
2222 upgradeToHttps : true ,
2323 compatibilityRules : true ,
2424 favorFlash : true ,
25+ hideRestoredMessage : false ,
2526 warnOnUnsupportedContent : true ,
2627 logLevel : LogLevel . Error ,
2728 showSwfDownload : false ,
Original file line number Diff line number Diff line change @@ -450,6 +450,13 @@ export interface BaseLoadOptions {
450450 */
451451 favorFlash ?: boolean ;
452452
453+ /**
454+ * Hide the message when content is restored from the back/forward cache.
455+ *
456+ * @default false
457+ */
458+ hideRestoredMessage ?: boolean ;
459+
453460 /**
454461 * This is no longer used and does not affect anything.
455462 * It is only kept for backwards compatibility.
You can’t perform that action at this time.
0 commit comments