- Complete React app with 7 developer tools - JSON Tool with visual structured editor - Serialize Tool with visual structured editor - URL, Base64, CSV/JSON, Beautifier, Diff tools - Responsive navigation with dropdown menu - Dark/light mode toggle - Mobile-responsive design with sticky header - All tools working with copy/paste functionality
28 lines
851 B
TypeScript
28 lines
851 B
TypeScript
/*
|
|
* Copyright 2020 Google LLC
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* https://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
interface onBFCacheRestoreCallback {
|
|
(event: PageTransitionEvent): void;
|
|
}
|
|
|
|
export const onBFCacheRestore = (cb: onBFCacheRestoreCallback) => {
|
|
addEventListener('pageshow', (event) => {
|
|
if (event.persisted) {
|
|
cb(event);
|
|
}
|
|
}, true);
|
|
};
|