11// ==UserScript==
22// @name XMOJ
3- // @version 2.2.1
3+ // @version 2.2.2
44// @description XMOJ增强脚本
55// @author @XMOJ -Script-dev, @langningchen and the community
66// @namespace https://github/langningchen
@@ -444,7 +444,7 @@ let UtilityEnabled = (Name) => {
444444let storeCredential = async ( username , password ) => {
445445 if ( 'credentials' in navigator && window . PasswordCredential ) {
446446 try {
447- const credential = new PasswordCredential ( { id : username , password : password } ) ;
447+ const credential = new PasswordCredential ( { id : username , password : password } ) ;
448448 await navigator . credentials . store ( credential ) ;
449449 } catch ( e ) {
450450 console . error ( e ) ;
@@ -454,7 +454,7 @@ let storeCredential = async (username, password) => {
454454let getCredential = async ( ) => {
455455 if ( 'credentials' in navigator && window . PasswordCredential ) {
456456 try {
457- return await navigator . credentials . get ( { password : true , mediation : 'optional' } ) ;
457+ return await navigator . credentials . get ( { password : true , mediation : 'optional' } ) ;
458458 } catch ( e ) {
459459 console . error ( e ) ;
460460 }
@@ -1627,8 +1627,9 @@ async function main() {
16271627 } , 1000 ) ;
16281628 } else {
16291629 let PID = localStorage . getItem ( "UserScript-Contest-" + SearchParams . get ( "cid" ) + "-Problem-" + SearchParams . get ( "pid" ) + "-PID" ) ;
1630-
1631- document . querySelector ( "body > div > div.mt-3 > center" ) . lastChild . style . marginLeft = "10px" ;
1630+ if ( document . querySelector ( "body > div > div.mt-3 > center" ) . lastElementChild !== null ) {
1631+ document . querySelector ( "body > div > div.mt-3 > center" ) . lastElementChild . style . marginLeft = "10px" ;
1632+ }
16321633 //修复提交按钮
16331634 let SubmitLink = document . querySelector ( '.mt-3 > center:nth-child(1) > a:nth-child(12)' ) ;
16341635 if ( SubmitLink == null ) { //a special type of problem
0 commit comments