Targeting Chromecast with CSS Media Queries - google-cast

What CSS3 Media Queries can we use to target Chromecast in the graphics view?
It doesn't seem to respond at all to something like:
#media tv and (device-width: 1280px){...}
The only query I have been able to get to work was:
#media(min-width: 1265px){...}
Which seems bonkers to me because the overscan is 32px anyway.
What are the best queries to use?
So far the best layout I have found is:
#media(min-width: 1265px) {
body {
position: absolute;
top: 18px;
right: 32px;
bottom: 18px;
left: 32px;
margin: 5px;
}
}
Which allows for the 18px * 32px overscan and an apparent additional 5px margin

Neil, I am not aware of a clean way to do this through Media Query at this point but you can potentially use the user agent fingerprint to discover that you are on the chromecast device; for example if strings "CrKey" and "TV" are in the user agent, then you are running on the chromecast.

Related

Is there any way to bypass Hcaptcha by using selenium python

Is there any way to bypass Hcaptcha by using selenium python,
I tried 2captcha(https://2captcha.com/) API, but it doesn't work
bypassing is sadly not an option. What you want to do is to retrieve a solution from sites like 2captcha, while having the solution you need to find the element with the name "h-captcha-response" and edit it so it is visible, after that you need to write the solution of your captcha and submit the form.
driver.execute_script("document.getElementByName('h-recaptcha-response').style = 'width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px;';")
driver.find_element(By.XPATH,'//*[#id="h-recaptcha-response"]').send_keys(recaptcha_solution)
this is a code I had laying around from another site, but it should make the h-captcha-response show up in your case as well, you need to find the XPATH of the element afterwards and write your own response and click the submit button.
If the code doesn't work try to find the h-recaptcha-response in the HTML and see if it is on the name or the ID of the element, this example assumes it has this name but it is also possible that it is on the ID, in that case you should use
driver.execute_script("document.getElementById('h-recaptcha-response').style = 'width: 250px; height: 40px; border: 1px solid rgb(193, 193, 193); margin: 10px 25px; padding: 0px;';")
While automating Captcha is not the best practice, there are three efficient ways of handling Captcha in Selenium:
By disabling the Captcha in the testing environment
Adding a hook to click the Captcha checkbox
By adding a delay to the Webdriver and manually solve Captcha while
testing

How do I build a drawer in Material Components Web?

I am just getting into Material Components for the Web and I want to have a website sort of like this, although I tried the code from the docs (that is obviously not complete) and got this. How can I get something like the example?
MDC-Web provides a drawer component but not an app’s layout where this drawer can iterate with the content, so you should compose the required layout yourself. And, apart from that, you will need the sort of CSS reset to style some elements consistently across browsers. This is not an incompleteness of library, but its philosophy - to provide only Material Design components rather than “all-in-one” solution for developers. This quote is taken from one of their GitHub issues:
The goal isn't to be a framework and do a lot of little functions for
developers. It's simply to provide the Material Design Specification's
components to the web in a re-usable way. That's it. Anything that is
beyond that goes beyond the scope of what the project is trying to
achieve.
So, in the provided link from MDC-Web, you can see that there are CSS styles applied to elements like html, body and their layout. Namely, this:
html {
height: 100%;
}
body {
display: flex;
flex-direction: column;
min-height: 100%;
margin: 0;
padding: 0;
box-sizing: border-box;
}
.demo-content {
display: flex;
flex: 1 1 auto;
height: 100%;
box-sizing: border-box;
}
.demo-main {
padding: 16px;
}
You can view the demo on Codepen and ask me if you need a further clarification.

SVG container renders wrong size in Safari desktop (fine in Chrome/iOS)

I thought Safari had sorted this but it still seems to be an issue (unless I'm doing something obviously wrong).
I have a SVG placed inside an object tag. That is wrapped in a flexible containing DIV (e.g set to be width 50%). On resize, the container height resizes in Firefox, Chrome and Opera as I would expect but on Safari the container stays too high.
Here's an example on Codepen to demonstrate, switch to the full size result or 'editor on side' (button bottom right) to see the effect clearly in Safari: http://codepen.io/benfrain/full/fhyrD
Besides using JS to resize the SVG on load/resize, does anyone know if there is anything else I can do to make Safari behave correctly? Could of sworn I'd figured this out a few weeks back but now I seem to be hitting the issue again.
So, Sérgio Lopez had an answer for this. You can employ the intrinsic ratio for video technique that Thierry Koblentz described here: http://alistapart.com/article/creating-intrinsic-ratios-for-video. More info at this blog post: http://benfra.in/20l
Here is the cut and paste code you need in your CSS:
Surrounding object tag
object {
width: 100%;
display: block;
height: auto;
position: relative;
padding-top: 100%;
}
And this for the SVG inside:
svg {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
}

site rendering differently on different hosts [closed]

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 9 years ago.
I have spent the last few hours trying to figure this out but still no luck...I think I have narrowed it down as something to do with a file permission issue on my host but maybe someone on here would be so kind as to point me in the right direction.
I have exactly the same files loaded onto two different domain, host combinations
http://northern.uwcs.co.uk/ApricotGum
http://apricotgum.co.uk
site a. renders fine but exactly the same files uploaded to site b. render in a very different way breaking most of the sites layout.
some of the problems with site b:
FlexSlider navigation does not work.(edit this is fixed by turning off mod-pagespeed with ?ModPagespeed=off# *)
Variety of layout problems.
Animations on the top logo do not work.
Please note the site is designed for mobile content...
Many thanks
Your CSS are different. In Chrome Dev Tools, there are noticeable differences between styles from W.main.css.pagespeed.cf.4qEnpEHvwU.css and main.css.
E.g. .header in W.main.css.pagespeed.cf.4qEnpEHvwU.css:
.header {
position: fixed;
top: 0;
left: 0;
width: 100%;
background-color: transparent;
z-index: 2;
}
In main.css:
.header {
position: fixed;
top: 0;
left: 0;
width: 0%;
z-index: 2;
background-color: rgba(0,0,0,0.5);
transition: width 1s ease;
-webkit-transition: width 1s ease;
-moz-transition: width 1s ease;
overflow: hidden;
padding-top: 0.25em;
}

nav menu not centering properly using 960 grid

im trying to create a basic profile for someone and am practicing using the 960 grid system.
I've since got the hang of using grids enough to position most elements, however the menu seems a little off to me, the right side seems to be bigger then the left, even though ive centered the menu itself and its at 100% width.
Does anybody have any ideas on why it is playing up?
Site url is http://digitalgenesis.com.au/sites/alice
css is http://digitalgenesis.com.au/sites/alice/css/main.css
Reduce the ".nav a:hover"-s padding. I think this is the problem.
Try the CSS like this:
.nav{margin-top: 20px;background:black; color:white; padding-top:10px; padding-bottom:10px;text-align:center; }
.nav li{display:inline; }
.nav a:hover{background:white; color:black; padding:10px 0px 10px 0px;}
.nav a{text-decoration:none; color:white; }
.footer{background:black; color:white; margin-top:20px; position:fixed; width:100%; bottom:0px;}
#top{width:100%; background:black; color:white;}
.title{font-size:26px; margin-top:45px; padding-left :10px;}
.wrapper{margin-top:50px;}
.logo{margin-left:0px;}

Resources