mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
ui: add experimental speculation rules
This commit is contained in:
3 files changed
+40
-9
No files matched your search
@@ -9,7 +9,7 @@ import Notification from 'vj/components/notification';
|
||||
import { downloadProblemSet } from 'vj/components/zipDownloader';
|
||||
import { NamedPage } from 'vj/misc/Page';
|
||||
import {
|
||||
delay, i18n, pjax, request, tpl,
|
||||
addSpeculationRules, delay, i18n, pjax, request, tpl,
|
||||
} from 'vj/utils';
|
||||
|
||||
const list = [];
|
||||
@@ -343,6 +343,17 @@ const page = new NamedPage(['problem_main'], () => {
|
||||
});
|
||||
$(document).on('vjContentNew', (e) => processElement(e.target));
|
||||
processElement(document);
|
||||
|
||||
addSpeculationRules({
|
||||
prerender: [{
|
||||
'where': {
|
||||
'or': [
|
||||
{ 'href_matches': '/p/*' },
|
||||
{ 'href_matches': '/d/*/p/*' },
|
||||
],
|
||||
},
|
||||
}],
|
||||
});
|
||||
});
|
||||
|
||||
export default page;
|
||||
Reference in new issue
Block a user