Render Webpages by Disabling Modernizr Features - modernizr

How do I render what a webpage will look like without a given Modernizr feature in Chrome?
How do people normally do this? And are there any more advanced ways?

it really depends on how they are being used.
you can manually change the html classes if you are trying to see the different styles. You can create a stub Modernizr object if its keyed off of that.
But in general, you should be testing in the browser where the results are false. Otherwise you are just sortof-kindof guessing

Related

SonarQube page extension with html possible?

I just read about extending SonarQube with custom pages. All examples I have found consist only of javascript files.
Is it possible to have html files as well or is it javascript only? If it is javascript only then the whole feature is completely useless as nobody wants to create all the html elements with javascript.
It's Javascript only.
However, there's a guide on how to use React to create the HTML elements, which makes it a lot more bearable. Try it!

How to add CKEditor plugins client-via side JavaScript?

Several online services that I use for work incorporate CKEditor (namely, desk.com and targetprocess.com), but neither includes find/replace functionality, because I guess neither knows that it's almost 2017.
I am pretty handy with JavaScript, and I wonder if there's a way to trick CKEditor into using a find/replace plugin such as http://ckeditor.com/addon/find via client-side JavaScript?
Obviously, I don't have access to the source code at either desk.com or targetprocess, and I am willing to "roll my own" until they get around to including it.
If the plugins you are looking for are in fact present on the websites you are using, then you may try destroying the CKEditor instance and starting CKEditor with your own settings e.g. with different toolbar and with plugins enabled via http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraPlugins (e.g. using Greasemonkey, by writing a browser extension that works on selected domains etc.)

Automatically fetch preview image from given URL in Rails

I need help again from the community.
I'm interested to know how to extract a preview image from a given URL in rails.
Basically, it would be a functionality like you have on reddit. When user submits a link (fills in the link field in the _form), a preview image/thumbnail is automatically pulled from a given url. (I would like to save the link of the image as a field in the model, I don't want to save the image itself).
Is there a gem for that or? What's the best way to do it?
Thanks for the help.
There is a gem
github.com/gottfrois/link_thumbnailer
that does exactly what I wanted.
I tested it, and it works as described, so I can recommend it.
You can use some wrappers around PhantomJS:
PhantomJS is a headless WebKit scriptable with a JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.
It's also known for its ability to make web page screenshots.
I found a couple of gems for you: screencap and webshot.
Example with screencap:
require 'screencap'
f = Screencap::Fetcher.new('http://google.com')
screenshot = f.fetch
You're also encouraged to check the documentation, it's pretty straightforward.

How to adapt my web page to different browser and different resolution?

I'm using asp.net MVC3 to create a website,but the webpage can not adapt to different browsers and resolution though i use the % in my webpage,anybody can help me?
Not sure what is not displaying properly.
I use the css grids and fonts from the Yahoo User Interface APIs. This takes care of the basic browser differences for me. Then I just add my HTML and CSS. Go and download the framework, it is really good. It will help you get a solid base for your CSS from which you can build.
All the best.

How to quickly write a firefox extension?

I'm to make a firefox extension which will inject some js code as well as whole jQuery lib.
I want it to happen (the injection) when user pushes the button placed somewhere in the browser. I have read docs form MDC and other tutorials about making the extensions and they seem complicated to me. Technologies such as XPCOM or XUL are completely useles form me (I have no time to learn them in fact). My question is, is it another way of solving my problem then following MDC? I need to find quicker way of doing my task.
I've already written the extension for Google Chrome, and it was a way simplier than doing it for Firefox.
I would take a look at Greasemonkey. It shares some similarity with Chrome plugins in function (Script gets injected on the page, local storage, etc). As for using JQuery with Greasemonkey, look at this question: How can I use jQuery in Greasemonkey?
You can use a bookmarklet to add jQuery to a page and/or inject any other code.

Resources