小笼包in蒸笼 2022-06-15 23:02
浏览 45
已结题

浏览器页面关闭了内存没有释放,随着脚本运行,浏览器提示内存不足,但是刷新页面又可以重新跑

问题遇到的现象和发生背景

浏览器页面关闭了内存没有释放,随着脚本运行,浏览器提示内存不足,但是刷新页面又可以重新跑

问题相关代码,请勿粘贴截图

if(href.indexOf('servicehall/business-activity-detail')!=-1){
let timer=setInterval(()=>{
if($('tbody.auxo-table-tbody').eq(0).length>0){
clearInterval(timer)
let rateLow=$('.activity-detail__word-special span').eq(1).text()
rateLow=rateLow.split('最低佣金:')
rateLow=rateLow[1]
rateLow=rateLow.split('%')
rateLow=parseInt(rateLow[0])
// console.log('最低佣金:')
// console.log(rateLow)
if(rateLow==0){
window.location.href=href
}
else{
pageFn()
function pageFn(){
let len=$('tbody.auxo-table-tbody').eq(0).find('tr.auxo-table-row.auxo-table-row-level-0').length
clickFn(0)
function clickFn(index){
let $tr=$('tbody.auxo-table-tbody').eq(0).find('tr.auxo-table-row.auxo-table-row-level-0').eq(index)
let rate=$tr.find('td').eq(5).text()
rate=rate.split('%')
rate=rate[0]
let price=$tr.find('td').eq(4).text()
price=price.split(' ')
price=price[1]
if(parseInt(rate)>=rateLow){
$('.unregistered-operation.role-item__btn').eq(index).click()
setTimeout(()=>{
if($('#price').length==0){
nextFn()
}
else{
var myinputEvent = document.createEvent("HTMLEvents");
myinputEvent.initEvent("input", true, true);
$('#price').val(price)
document.querySelector('#price').dispatchEvent(myinputEvent);
setTimeout(()=>{
$('#rate').val(rate)
document.querySelector('#rate').dispatchEvent(myinputEvent);
setTimeout(()=>{
$('#stock').val(100)
document.querySelector('#stock').dispatchEvent(myinputEvent);
setTimeout(()=>{
$('#phone_num').val(15980186430)
document.querySelector('#phone_num').dispatchEvent(myinputEvent);
setTimeout(()=>{
$('#wechat_id').val('imjinwen')
document.querySelector('#wechat_id').dispatchEvent(myinputEvent);
setTimeout(()=>{
$('.auxo-input.cooperate-selling-point__textarea').val('京东销量过万,价格超级丝滑,品质直入人心')
document.querySelector('.auxo-input.cooperate-selling-point__textarea').dispatchEvent(myinputEvent);
setTimeout(()=>{
$('.auxo-btn.auxo-btn-primary.cooperate-selling-point__submit').click()
setTimeout(()=>{
nextFn()
},2000)
},1000)
},1000)
},1000)
},1000)
},1000)
},1000)
}
},1000)
}
else{
nextFn()
}

                        function nextFn() {
                            index++
                            if (index<len){
                                clickFn(index)
                            }
                            else{
                                if($('.auxo-pagination-next.auxo-pagination-disabled').length==0){
                                    $('.auxo-pagination-next').click()
                                    setTimeout(()=>{
                                        pageFn()
                                    },3000)
                                }
                                else{
                                    layer.msg('此达人报名成功')
                                    // console.log('此达人报名成功')
                                    let listIndex=localStorage.getItem('listIndex')
                                    let list=JSON.parse(localStorage.getItem('list'))
                                    listIndex++
                                    localStorage.setItem('listIndex',listIndex)
                                    if(listIndex<list.length){
                                        let url=`https://buyin.jinritemai.com/dashboard/servicehall/business-activity-detail?event_id=${list[listIndex]}&tab_num=1&isSigned=1&isInstitution=0`

                                        window.open(url)
                                        window.close()
                                    }
                                    else{
                                        layer.msg('all报名成功')
                                        console.log('all报名成功')
                                    }
                                }
                            }
                        }

                    }
                }
            }

        }
    },6000)

}
运行结果及报错内容

随着脚本运行,浏览器提示内存不足,但是刷新页面又可以重新跑

各位帮忙看看是什么原因以及解决方法

  • 写回答

0条回答 默认 最新

    报告相同问题?

    问题事件

    • 系统已结题 6月23日
    • 创建了问题 6月15日

    悬赏问题

    • ¥15 编辑cmake lists 明明写了project项目名,但是还是报错怎么回事
    • ¥15 关于#计算机视觉#的问题:求一份高质量桥梁多病害数据集
    • ¥15 特定网页无法访问,已排除网页问题
    • ¥50 如何将脑的图像投影到颅骨上
    • ¥15 提问一个关于vscode相关的环境配置问题,就是输入中文但是显示不出来,代码在idea可以显示中文,但在vscode不行,不知道怎么配置环境
    • ¥15 netcore使用PuppeteerSharp截图
    • ¥20 这张图页头,页脚具体代码该怎么写?
    • ¥15 关于#sql#的问题,请各位专家解答!
    • ¥20 WPF MVVM模式 handycontrol 框架, hc:SearchBar 控件 Text="{Binding NavMenusKeyWords}" 绑定取不到值
    • ¥15 需要手写数字信号处理Dsp三个简单题 不用太复杂