Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

the web interface is too small #740

Open
lyright opened this issue Sep 27, 2017 · 13 comments
Open

the web interface is too small #740

lyright opened this issue Sep 27, 2017 · 13 comments

Comments

@lyright
Copy link

lyright commented Sep 27, 2017

I've tried chrome, firefox on both Win 10 and Mac
pyspider version 0.3.9
image
image

@csj110
Copy link

csj110 commented Oct 11, 2017

我在chrome上打开http://demo.pyspider.org也会界面小 换了firefox后开始也很小 过了几秒就好了 也不知道什么原因

@dbafu
Copy link

dbafu commented Oct 23, 2017

this style in debug.min.css:

#tab-web iframe {
border-width: 0;
width: 100%;
}

caused the bug

changed it to a explicit value like this:

#tab-web iframe {
border-width: 0;
width: 100%;
height: 900px #according to your screen as you like to (768-900 or larger value)
}

you can change the page source code via developer tool (press f12 in win , option + command + i in macOS) temporarily .

<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="100%"></iframe>

to

<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="900px"></iframe>

as a hack

ok2fly added a commit to ok2fly/pyspider that referenced this issue Oct 23, 2017
fix the bug "the web interface is too small "  
mentioned in binux#740
@ok2fly
Copy link

ok2fly commented Oct 23, 2017

changed it to a explicit value like this:

#tab-web iframe {
border-width: 0;
width: 100%;
height: 900px #according to your screen as you like to (768-900 or larger value)
}

still have bug

@ok2fly
Copy link

ok2fly commented Oct 23, 2017

to fix the bug completly for all browser is too hard for me. so sorry .

1
------debug-min.js--
change

$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="50%"></iframe>');
to
$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="100%"></iframe>');


this work for chrome,but in firefox , one more height is added, i do not know why.

<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="60px" height="100%"></iframe>

2

in debug.min.css change to below:

#debug-tabs{margin-bottom:45px;height:100%}#tab-web.fixed{padding-top:24px}#tab-web{height:100%}.iframe-box{height:100%}#tab-web iframe{border-width:0;width:100%}#tab-html


this will work fine in chrome, but not for firefox and safari

@binux
Copy link
Owner

binux commented Oct 23, 2017

By design the height of iframe show adjusted by JS after page loaded:

doc.onreadystatechange = () => {

@ok2fly
Copy link

ok2fly commented Oct 23, 2017

so you can fix it by doing this:
1
in debug.min.css change to below:

#debug-tabs{margin-bottom:45px;height:100%}#tab-web.fixed{padding-top:24px}#tab-web{height:100%}.iframe-box{height:100%}#tab-web iframe{border-width:0;width:100%}#tab-html

I add 3 height:100% and a .iframe-box{height:100%} compared to original file


2
in debug.min.js change to below:

change

$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="50%"></iframe>');

to

$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="100%"></iframe>');

and delete

a.onreadystatechange=function(){"complete"===a.readyState&&$("#tab-web iframe").height(a.body.scrollHeight+60)},


finished the above,will fix the bug.

this will work fine in both firefox and chrome.

in safari this error will happen because of security limit in safari that limitting access local file prevent css and js loads.
SecurityError (DOM Exception 18): The operation is insecure.
Failed to load resource: the server responded with a status of 404 (NOT FOUND)

@dbafu
Copy link

dbafu commented Oct 23, 2017

0
in /usr/local/lib/python3.6/site-packages/pyspider/webui/templates/debug.html
change
<div id="debug-tabs" >

to
<div id="debug-tabs" style="height:100%;">

this fix a css bug in firefox

1
in debug.min.css change to below:

#debug-tabs{margin-bottom:45px;height:100%}#tab-web.fixed{padding-top:24px}#tab-web{height:100%}.iframe-box{height:100%}#tab-web iframe{border-width:0;width:100%}#tab-html
I add 3 height:100% and a .iframe-box{height:100%} compared to original file

2
in debug.min.js change to below:

change

$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="50%"></iframe>');
to

$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="100%"></iframe>');
and delete

a.onreadystatechange=function(){"complete"===a.readyState&&$("#tab-web iframe").height(a.body.scrollHeight+60)},

@LittleGhosts
Copy link

I tried to modify the debug.min.css and debug.min.js file, but it still looks like this
image

I use the chrome and the pyspider 0.3.10

@cheniia
Copy link

cheniia commented Aug 7, 2018

@LittleGhosts It's useful to change debug.min.js for Chrome like this:
change
$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="50%"></iframe>');
to
$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="900px"></iframe>');

@LittleGhosts
Copy link

LittleGhosts commented Aug 8, 2018

I've tried to change what's in debug.min.js, and I've changed what's in debug.min.css the previous way, but it's still looks like this
image
image

@ivanhuanghhh
Copy link

I use mac, I edit /usr/local/lib/python3.6/site-packages/pyspider/webui/static/debug.min.js file

// before
a.onreadystatechange = function () { 
  "complete" === a.readyState && $("#tab-web iframe").height(a.body.scrollHeight + 60) 
}
// after, change 60 to 900
a.onreadystatechange = function () { 
  "complete" === a.readyState && $("#tab-web iframe").height(a.body.scrollHeight + 900) 
}

It work for me. the 900 depends on your screen

@pythonwood
Copy link

pythonwood commented Dec 5, 2018

@LittleGhosts It's useful to change debug.min.js for Chrome like this:
change
$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="50%"></iframe>');
to
$("#tab-web .iframe-box").html('<iframe src="/blank.html" sandbox="allow-same-origin allow-scripts" height="900px"></iframe>');

It work for me , and change 900px a suitable XXpx. ( no use while filling like 80% ...)

@xyb
Copy link
Contributor

xyb commented Apr 16, 2023

I think this issue was introduced in 59f3e4e because the automatic height adjustment depends on readystatechange, but the iframe only has load events.
see also: https://stackoverflow.com/a/36640131/150841

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants