- 浏览: 21053 次
- 性别:
- 来自: 深圳
最新评论
maxthon2.0 delicious sidebar验证失败
最近安装maxthon2.0,用来其delicious sidebar插件,原来工作正常,现在出现问题,卸载house重新安装sidebar,出现验证无法通过。检查其Delicious.js代码,由于原有网址http://del.icio.us,改为http://delicious.com/,所以无法验证,验证时必须有http://delicious.com/yourname网页打开,而且添加网址时标题不能超过255个字节。修改js如下:
- /**************************
- Del.icio.usSidebar
- ByNeo101
- Version1.2.1
- **************************/
- checkSettingsFile()
- varauthUser=readSetting('authUser')
- varsplit=authUser.split('%20')
- varuserName=split?split[0]:''
- varshowTooltip=readSetting('showTooltip','1')
- varautoUpdateTime=parseInt(readSetting('autoUpdateTime','0'))
- if(isNaN(autoUpdateTime)){
- autoUpdateTime=0
- }
- varsortTags=readSetting('sortTags','1')
- varsortFavorites=readSetting('sortFavorites','1')
- varuseBundles=readSetting('useBundles','1')
- varbaseURL='https://api.del.icio.us/v1/'
- varfavoritesCache='cache/favorites.html'
- varfavoritesHTML=''
- varposts=newArray()
- varbundleArray=newArray()
- varbranch=0
- varxmlhttp
- vareditElement
- varisAddFavorite=true
- varTRUE='1'
- varFALSE='0'
- //vardeliciousURL='http://del.icio.us/';
- vardeliciousURL='http://delicious.com/'
- vardeliciousSettingURL='https://secure.delicious.com/settings/'
- window.onload=function(){
- if(authUser==''){
- displaySettings()
- document.getElementById('settingsLinks').style.display='none'
- document.getElementById('mainSettings').style.display='none'
- document.getElementById('links').style.display='none'
- document.getElementById('aboutDelicious').style.display=''
- }else{
- viewFavorites()
- getLastUpdateTime()
- setLinks()
- }
- setAutoUpdate()
- //cleanoldlogindata
- if(readSetting('userName','')!=''){
- writeSetting('userName','')
- writeSetting('password','')
- }
- }
- functionsetLinks(){
- document.getElementById('yourFavoritesLink').href=deliciousURL+userName
- document.getElementById('yourNetworkLink').href=deliciousURL+'network/'+userName
- document.getElementById('importBookmarksLink').href=deliciousSettingURL+userName+'/bookmarks/import'
- document.getElementById('exportBookmarksLink').href=deliciousSettingURL+userName+'/bookmarks/export'
- document.getElementById('editBundleLink').href=deliciousSettingURL+userName+'/tags/bundle?noredir'
- }
- functionsetAutoUpdate(){
- if(autoUpdateTime<5){
- return
- }
- vartime=autoUpdateTime*1000*60
- window.setInterval(getLastUpdateTime,time)
- }
- functionloadXMLDoc(url,type,stateChange,data){
- if(authUser==''){
- showError('Userinformationnotdefined!')
- return
- }
- try{
- xmlhttp=external.max_activex(SECURITY_ID,"Microsoft.XMLHTTP")
- }
- catch(err){
- try{
- xmlhttp=newActiveXObject("Microsoft.XMLHTTP")
- }
- catch(err){
- showError('CouldnotloadActiveXobject')
- }
- }
- xmlhttp.onreadystatechange=stateChange
- xmlhttp.open("POST",url,true,'cookie','cookie')
- xmlhttp.setRequestHeader('User-Agent','Maxthondel.icio.ussidebarplugin')
- xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
- xmlhttp.setRequestHeader('Referrer','Maxthondel.icio.ussidebarplugin')
- vardata='_user='+authUser
- xmlhttp.send(data)
- }
- functioncheckReadyState(obj){
- if(obj.readyState==4){
- //alert(obj.responseText)
- if(obj.status==200||obj.status==201){
- returntrue;
- }
- elseif(obj.status==401||obj.status==403){
- varmessage='Couldnotlogin.Pleasecheckyour'+
- '<ahref="#"onclick="displaySettings()"style="color:red;text-decoration:underline">logininformation!</a>'
- showError(message)
- document.getElementById('favorites').innerHTML=message
- writeFile(favoritesCache,'')
- }
- elseif(obj.status==503){
- showError('Error503:Pleasetryagaininacoupleofminutes..')
- }
- else{
- showError(obj.status+''+obj.responseText);
- }
- }
- }
- functiongetLastUpdateTime(){
- varurl=baseURL+'posts/update?'+Math.round(Math.random()*1000)
- showError('Checkingforupdates...')
- loadXMLDoc(url,'getLastUpdateTime',onResponseGetLastUpdateTime)
- }
- functiononResponseGetLastUpdateTime(){
- if(!checkReadyState(xmlhttp)){
- return
- }
- varresponseXML=xmlhttp.responseXML
- if(responseXML==null){
- showError('ErrorloadingXML')
- return
- }
- try{
- varlastUpdateTime=responseXML.getElementsByTagName("update")[0].getAttribute('time')
- }catch(err){
- showError('badresponsegettingtime...')
- alert(xmlhttp.responseText)
- return
- }
- varpreviousUpdateTime=readSetting('UpdateTime')
- if(previousUpdateTime!=lastUpdateTime){
- showError('Updateavailable')
- writeSetting('UpdateTime',lastUpdateTime)
- window.setTimeout(updateFavorites,1000)
- }else{
- showError('Nofavoriteupdates')
- }
- }
- functionviewFavorites(){
- varhtml=unescape(readFile(favoritesCache))
- if(html==null||html==''){
- writeSetting('UpdateTime','')
- return
- }
- favoritesHTML=html
- currentlyOpenFolder=null
- document.getElementById('favorites').innerHTML=html
- }
- functiongetBundles(){
- varurl=baseURL+'tags/bundles/all?'+Math.round(Math.random()*1000)
- showError('Checkingforbundles...')
- loadXMLDoc(url,'getBundles',onResponseGetBundles)
- }
- functiononResponseGetBundles(){
- if(!checkReadyState(xmlhttp)){
- return
- }
- varresponseXML=xmlhttp.responseXML
- if(responseXML==null){
- showError('ErrorloadingBundleXML')
- return
- }
- bundleArray=newArray()
- varbundleTags=responseXML.getElementsByTagName("bundles")[0].childNodes
- for(vari=0;i<bundleTags.length;i++){
- bundleArray.push(newArray(bundleTags[i].getAttribute('name'),bundleTags[i].getAttribute('tags')))
- }
- window.setTimeout(downloadFavorites,1000)
- }
- functionupdateFavorites(){
- if(useBundles=='1'){
- getBundles()
- }else{
- downloadFavorites()
- }
- }
- functiondownloadFavorites(){
- varurl=baseURL+'posts/all?'+Math.round(Math.random()*1000)
- showError('Updating...')
- loadXMLDoc(url,'viewFavorites',onResponseViewFavorites)
- }
- functiononResponseViewFavorites(){
- if(!checkReadyState(xmlhttp)){
- return
- }
- varresponseXML=xmlhttp.responseXML
- if(responseXML==null){
- showError('ErrorloadingXML')
- return
- }
- varresponse=''
- posts=newArray()
- items=responseXML.getElementsByTagName("post");
- if(items&&items.length!=0){
- for(varj=0;j<items.length;j++){
- addPost(items[j],posts)
- }
- }
- else{
- response+='<b>Nofavoritesfound</b>'
- }
- vartags=newArray()
- addPostsToTags(posts,tags)
- if(sortTags=='1'){
- tags.sort()
- }
- response+=writeTree(tags)
- writeFile(favoritesCache,escape(response))
- favoritesHTML=response
- showError('FavoritesDownloaded')
- document.getElementById('favorites').innerHTML=response
- currentlyOpenFolder=null
- document.getElementById('searchbox').value=''
- }
- functiontitleSort(a,b){
- try{
- a=a.description.toLowerCase()
- b=b.description.toLowerCase()
- if(a<b){
- return-1
- }else{
- return1
- }
- }
- catch(err){
- return1
- }
- }
- functionaddPostsToTags(postsArray,tagsArray){
- for(vari=0;i<postsArray.length;i++){
- vartags=postsArray[i].tag.toLowerCase()
- vartagArray=tags.split('')
- for(varj=0;j<tagArray.length;j++){
- varposition=inArray(tagArray[j],tagsArray)
- if(position>=0){
- tagsArray[position][1].push(postsArray[i])
- }else{
- tagsArray.push(newArray(tagArray[j],newArray(postsArray[i])))
- }
- }
- }
- }
- functionwriteTree(tagsArray){
- varhtml=''
- varunfiledHtml=''
- for(vari=0;i<bundleArray.length;i++){
- varname=bundleArray[i][0]
- vartags=bundleArray[i][1].toLowerCase().split('')
- varbranchNumber=branch+10000
- html+=returnFolderHtml(branchNumber,name,true)
- html+=addTags(tags,tagsArray)
- html+='</div>/n'
- branch++
- }
- for(vari=0;i<tagsArray.length;i++){
- if(tagsArray[i][0]=='system:unfiled'){
- unfiledHtml=addLinks(tagsArray[i][1])
- continue
- }
- html+=returnTagHtml(tagsArray[i],true)
- }
- html+=unfiledHtml
- returnhtml
- }
- functionreturnFolderHtml(number,name,isBundle){
- if(isBundle!=null){
- varimageSrc='images/bundleClosed.gif'
- }else{
- varimageSrc='images/folderClosed.gif'
- }
- return'<divclass="trigger"onclick="expandCollapse('+number+')"oncontextmenu="showContextMenu(this);returnfalse"'+
- 'onmouseover="this.style.textDecoration=/'underline/'"onmouseout="this.style.textDecoration=/'none/'">'+
- '<imgsrc="'+imageSrc+'"border="0"id="folder'+number+'">'+
- name+
- '</div>/n<divclass="branch"id="branch'+number+'">'
- }
- functionaddTags(tags,tagsArray){
- varhtml=''
- for(vari=0;i<tags.length;i++){
- varposition=inArray(tags[i],tagsArray)
- if(position>-1){
- html+=returnTagHtml(tagsArray[position])
- }
- tagsArray.splice(position,1)
- }
- returnhtml
- }
- functionreturnTagHtml(tag,isHighBranch){
- if(isHighBranch!=null){
- varbranchNumber=branch+10000
- }else{
- varbranchNumber=branch
- }
- varhtml=returnFolderHtml(branchNumber,tag[0])
- html+=addLinks(tag[1])
- html+='</div>/n'
- branch++
- returnhtml
- }
- functionaddLinks(items){
- varhtml=''
- if(sortFavorites=='1'){
- items.sort(titleSort)
- }
- for(vari=0;i<items.length;i++){
- varitem=items[i]
- html+='<divclass=linkDivoncontextmenu="showContextMenu(this);returnfalse">'+
- '<aclass=linkhref="'+item.href+'"target=_blanktitle="'+item.tooltip+'"'+
- 'onmouseover="showLink(this.href)"onmouseout="hideLink()"'+
- 'extended="'+item.extended+'"tag="'+item.tag+'"hashCode="'+item.hash+'">'+
- '<imgsrc="images/page.gif">'+
- item.description+
- '</a>'+
- '</div>/n'
- }
- returnhtml
- }
- functionaddPost(item,array){
- varhref=item.getAttribute('href')
- vardescription=item.getAttribute('description')
- vartag=item.getAttribute('tag')
- vartime=item.getAttribute('time')//.substring(0,10)
- varhash=item.getAttribute('hash')
- varextended=item.getAttribute('extended')
- if(extended==null){
- extended=''
- }
- //timeslike2004-09-16T00:00:00Z
- vardate=newDate()
- date.setISO8601(time)
- time=date.toLocaleString()
- if(showTooltip=='1'){
- vartooltip='Added:'+time
- varMAX_DESCRIPTION_LENGTH=30
- if(description.length>MAX_DESCRIPTION_LENGTH){
- tooltip=description+'/n'+tooltip
- }
- if(extended){
- tooltip+='/nNote:'+extended
- }
- }else{
- vartooltip=''
- }
- array.push({'href':href,
- 'description':description,
- 'tag':tag,
- 'time':time,
- 'hash':hash,
- 'extended':extended,
- 'tooltip':tooltip
- })
- }
- functiononResponsePostFavorite(){
- if(!checkReadyState(xmlhttp)){
- return
- }
- varresponseXML=xmlhttp.responseXML
- if(responseXML==null){
- showError('ErrorloadingXML')
- return
- }
- try{
- varresponse=responseXML.getElementsByTagName("result")[0].getAttribute('code')
- }catch(err){
- showError('badresponsePosting...')
- alert(xmlhttp.responseText)
- return
- }
- if(response=='done'){
- showError('Favoriteadded!')
- window.setTimeout('getLastUpdateTime()',1000)
- }
- }
- functiondeleteFavorite(url){
- varurl=baseURL+'posts/delete?url='+encodeURIComponent(url)
- showError('deleting...')
- loadXMLDoc(url,'deleteFavorite',onResponseDeleteFavorite)
- }
- functiononResponseDeleteFavorite(){
- if(!checkReadyState(xmlhttp)){
- return
- }
- varresponseXML=xmlhttp.responseXML
- if(responseXML==null){
- showError('ErrorloadingXML')
- return
- }
- try{
- varresponse=responseXML.getElementsByTagName("result")[0].getAttribute('code')
- }catch(err){
- showError('badresponseDeleting...')
- alert(xmlhttp.responseText)
- return
- }
- if(response=='done'){
- showError('Favoritedeleted!')
- window.setTimeout('getLastUpdateTime()',1000)
- }else{
- showError('Error:'+response)
- }
- }
- functiongetCurrentWebsiteURL(){
- returnexternal.get_tab(SECURITY_ID,external.cur_sel).document.URL
- }
- functiongetCurrentWebsiteTitle(){
- returnexternal.get_tab(SECURITY_ID,external.cur_sel).document.title
- }
- functiongetEditWebsiteURL(){
- returneditElement.href
- }
- functiongetEditWebsiteTitle(){
- returneditElement.innerText
- }
- functiongetEditWebsiteNotes(){
- returneditElement.extended
- }
- functiongetEditWebsiteTags(){
- returneditElement.tag
- }
- functiondisplaySettings(){
- loadSettings()
- document.getElementById('favorites').style.display='none'
- document.getElementById('settings').style.display=''
- document.getElementById('message').style.display='none'
- document.getElementById('menu').style.display='none'
- document.getElementById('showSettings').onclick=function(){hideSettings()}
- }
- functiongetDeliciousCookie(){
- vardeliciousWindow=getDeliciousWindow()
- if(deliciousWindow==null){
- window.open(deliciousURL);
- }
- vardeliciousWindow=getDeliciousWindow()
- if(deliciousWindow){
- if(deliciousWindow.document.readyState=='complete'){
- saveCookie(deliciousWindow.document.cookie)
- }else{
- deliciousWindow.document.onreadystatechange=function(){
- if(deliciousWindow.document.readyState=='complete'){
- saveCookie(deliciousWindow.document.cookie)
- }
- }
- }
- }
- }
- functionsaveCookie(cookie){
- varmatch=cookie.match(/.*?_user=(.*?)(;|$)/)
- if(match){
- varuser=match[1]
- writeSetting('authUser',user)
- alert('Authenticated!')
- }else{
- writeSetting('authUser','')
- alert('Cookieproblem!/nCouldnotauthenticateyou./nMakesureyouareloggedintodelicious.com')
- }
- }
- functiongetDeliciousWindow(){
- varwin
- for(vari=0;i<external.tab_count;i++){
- win=external.get_tab(SECURITY_ID,i)
- if(win.document.URL.indexOf(deliciousURL)!=-1){
- returnwin
- }
- }
- returnnull
- }
- functionhideSettings(){
- document.getElementById('favorites').style.display=''
- document.getElementById('settings').style.display='none'
- document.getElementById('message').style.display='none'
- document.getElementById('menu').style.display=''
- document.getElementById('showSettings').onclick=function(){displaySettings()}
- }
- functioncancel(){
- hideSettings()
- if(authUser==''){
- varmessage='<ahref="javascript:displaySettings()">Loginfirst!</a>'
- document.getElementById('favorites').innerHTML=message
- }
- }
- functionsave(){
- /*if(userName!=userNameNew){
- writeFile(favoritesCache,'')
- }*/
- writeSetting('UpdateTime','')
- saveSettings()
- location.reload()
- }
- functioninArray(text,array){
- for(vari=0;i<array.length;i++){
- if(text==array[i][0]){
- returni
- }
- }
- return-1
- }
- functionloadSettings(){
- varallInputTags=document.getElementsByTagName('input')
- for(vari=0;i<allInputTags.length;i++){
- if(allInputTags[i].type=='checkbox'){
- if(readSetting(allInputTags[i].id+'')==TRUE){
- allInputTags[i].checked=true
- }
- else{
- allInputTags[i].checked=false
- }
- }
- if(allInputTags[i].type=='text'&&allInputTags[i].id!='searchbox'&&allInputTags[i].onkeydown==null){
- allInputTags[i].value=eval(allInputTags[i].id+'')
- }
- }
- }
- functionsaveSettings(){
- varallInputTags=document.getElementsByTagName('input');
- for(vari=0;i<allInputTags.length;i++){
- if(allInputTags[i].type=='checkbox'){
- if(allInputTags[i].checked==true){
- writeSetting(allInputTags[i].id+'',TRUE)
- }
- else{
- writeSetting(allInputTags[i].id+'',FALSE)
- }
- }
- if(allInputTags[i].type=='text'&&allInputTags[i].id!='searchbox'&&allInputTags[i].onkeydown==null){
- writeSetting(allInputTags[i].id+'',allInputTags[i].value)
- }
- }
- }
相关推荐
Maxthon2.0.4.5799 苦菜花增强优化绿色精简版(0931)
Maxthon2.0.3.4552 苦菜花增强优化清爽精简版
Maxthon2.0.3.4552 苦菜花增强优化安装版
Maxthon2.0.4.5799 苦菜花增强优化安装版
Maxthon2.0.4.5799 苦菜花增强优化安装版(0931)
Maxthon2.0.7.1245苦菜花增强优化安装版
Maxthon2.0.4.5799 苦菜花增强优化清爽精简版是一款基于Maxthon浏览器的定制版本,旨在提供更为高效、轻便的浏览体验。Maxthon浏览器是一款多内核的网络浏览器,它支持Webkit(如Chrome内核)和IE内核,以实现对不同...
Maxthon2.0.3.4552苦菜花增强优化安装版
Maxthon2.0.3.4552苦菜花增强优化绿色完整版
Maxthon2.0.3.4020 RC苦菜花增强优化安装版(0822)
=========================================== Maxthon2.0.2.2961百度爱好者优化版(0819) =========================================== 苦菜花 2007年8月19日 百度爱好者:... 1:使用苦菜花综合优化...
Maxthon2.0.3.4552苦菜花增强优化精简版是一款基于旧版本Maxthon浏览器的定制化版本,旨在提供更快、更稳定且占用资源更少的浏览体验。这款精简版可能去除了原版中的一些非核心功能,以实现更高的效率和速度。下面将...
这个特定的版本,"Maxthon2.0.7.1245苦菜花增强优化精简版(1230)",是基于早期的Maxthon 2系列,并且经过了第三方的“苦菜花”团队的增强和优化。这个精简版意味着它可能去除了不必要的组件,以提供更快的启动速度和...
============================================ Maxthon2.0.3.4020 RC 1苦菜花增强优化版(0822) ============================================ 苦菜花 2007年8月22日 苦菜花卓越电脑家园:...
============================================ Maxthon2.0.3.4020 RC 1苦菜花增强优化版(0822) ============================================ 苦菜花 2007年8月22日 苦菜花卓越电脑家园:...
傲游(Maxthon)2.0 RC1
【傲游(Maxthon)浏览器 V2.0 hao123专版】是Maxthon公司为用户特别定制的一款浏览器版本,旨在提供更加便捷的上网体验,尤其是针对喜欢使用hao123导航网站的用户。这个专版浏览器集成了hao123的常用网址和服务,使得...
《傲游(Maxthon)浏览器 V2.0.8.1720 新春版:技术创新与用户体验的完美融合》 傲游(Maxthon)浏览器是一款深受用户喜爱的多平台网络浏览工具,其V2.0.8.1720新春版的发布,不仅在功能上进行了优化升级,更在用户体验...
更新时间:2007-11-05 Maxthon 是一个高度可定制的强大 Web 浏览器. 它基于 Internet Explorer 内核(可能正是您当前使用的默认浏览器), 这意味着它的效果和您在 IE 中看到的效果完全相同, 同时它还给您提供如下的...
傲游(Maxthon2) 简体中文版 2.0.7.1030