How can I make fiddles enter full-screen? - fullscreen

I was trying to create some POC to try something with jwplayer but for some reason full screen for jwplayer is not working.
Is there any way to make full-screen work in jsfiddle in jwplayer?
Here is my jsfiddle
http://jsfiddle.net/hiteshbhilai2010/6YyXH/63/

Answering too late, but as no share button is available now, the new way for going full screen is copying the URL of your fiddle and append /show to it.
Example : https://fiddle.net/xyz123/show/
This will show you only the result frame in full screen.

You can click on Share button, then take the Full screen result URL, open it, go to full screen in player and then (optionally) click on F11
Another quick way: right click on jsfiddle result --> View frame source --> In the view source tab take the iframe URL and open it, the player full screen should work. If you are intending to use the fiddle as a demonstration, you can write some javascript to grab the url of the underlying iframe and open it in a new window.

In firefox only:
Right-Click the result window in Jsfiddle
Select "This Frame"
Select "Show Only This Frame"
Page will reload with result only in full screen (without a "run this fiddle" banner in it.)
Sometimes however this won't work, I not shure why, but you can always add "/show" to the URL as Zameer Fouzan has said.
If you don't want to see the "Edit in Jsfiddle" button you can always remove it:
Add "/show" to the URL and press ENTER
Press "run this fiddle" button
Press F12 to enter developer mode in FireFox or Chrome
In firefox press: CTRL + SHIFT + C to pick an element from the page
Press the "Edit in Jsfiddle" button, the corresponding code will be highlighted
Right-Click the highlighted line of code
Select "Delete Node"
Press F12 to close developer mode

Open your browser's console and run this:
const div = document.createElement('div')
div.classList.add('actionItem', 'visible')
div.style.cursor = 'pointer'
const a = document.createElement('a')
a.innerText = 'Fullscreen'
a.classList.add('aiButton')
a.title = 'Fullscreen'
a.addEventListener('click', function() {
document.querySelector('iframe[name=result]').requestFullscreen()
})
div.appendChild(a)
document.querySelector('.actionCont').insertBefore(div, document.getElementById('app-updates'))
This will add a button with the text "Fullscreen" next to the "Embed" button. If you click on it, your browser should fullscreen the result.
Or, if you don't want to paste something in the browser console every time you go to edit a fiddle, use a userscript:
// ==UserScript==
// #name JSFiddle Fullscreen
// #match *://jsfiddle.net/*
// #version 1.0
// #author GalaxyCat105
// #description Adds a fullscreen button in the JSFiddle navigation menu when editing a fiddle
// #grant none
// ==/UserScript==
const div = document.createElement('div')
div.classList.add('actionItem', 'visible')
div.style.cursor = 'pointer'
const a = document.createElement('a')
a.innerText = 'Fullscreen'
a.classList.add('aiButton')
a.title = 'Fullscreen'
a.addEventListener('click', function() {
document.querySelector('iframe[name=result]').requestFullscreen()
})
div.appendChild(a)
document.querySelector('.actionCont').insertBefore(div, document.getElementById('app-updates'))
Create a new script in your favorite userscript manager and copy-paste the code into it.

Related

Webdriver.io Scroll List

I use CodeceptJS with webdriver.io as helper to do e2e test for a website. There is a ul (unordered list) and I want to scroll down to this list. There is scroll bar and I used buttonDown and buttonUp methods on the scroll bar to perform but couldn't figure it out.
Thanks in advance.
To scroll down:
client
.url('https://www.yourwebsite.com')
.leftClick('#yourtable') // <-- should also work with .click()
.scroll(0, 500) // the higher the more we scroll
to use keys make sure to click on the list div box before that the emulated mouse is at the item you want to scroll down. Then you can press the down key to go down:
/*
\uE014 "ArrowRight"
\uE015 "ArrowDown"
*/
client
.leftClick('#yourtable') // <-- should also work with .click()
.keys('ArrowDown')
.keys('ArrowDown')
.keys('ArrowDown')
// or
.keys('\uE015')
.keys('\uE015')
.keys('\uE015')
Source: api/protocol/keys.html

How to open a hyperlink in separate browser tab in Coded UI

I have three different Hyperlinks on a web page
Planning.
Solutions.
Contact Us.
I want to open them in separate browser tab one by one using codedUI.
i have written the above code to obtain the list of Hyperlink
HtmlControl Hyperlink = new HtmlControl(browser);
Hyperlink.SearchProperties.Add(HtmlControl.PropertyNames.ControlType,"Hyperlink");
UITestControlCollection controls = Hyperlink.FindMatchingControls();
foreach(UITestControl control in controls)
{
if (control is HtmlHyperlink)
{
HtmlHyperlink link = (HtmlHyperlink)control;
if(link.InnerText=="Planning"|| link.InnerText== "Solutions")
{
//separate Tab logic goes here
}
}
}
I need the help related to opening a hyperlink in new browser tab. Is it possible in CodedUI ?
By default if you click the mouse middle button (or click the scroll wheel), it opens a link in new tab. I would modify your code as below in this case,
if(link.InnerText=="Planning"|| link.InnerText== "Solutions")
{
//Open Link in New tab, by clicking middle button
Mouse.Click(link, MouseButtons.Middle);
}
You can do this a couple different ways. I would use #Prageeth-Saravan 's approach first to see if it works because it's easier and actually tests your UI. You could also:
Get the URL from the found link control
Send the "New tab" keyboard shortcut
Reinstantiate your browser window object to be sure it's pointing to the new tab
Navigate to that URL
The reason why I bolded step 3 is regardless of approach, if you intend to assert or interact with anything in a new tab you're going to have to remember that the CodedUI software will still be "Looking" at the old tab until you reinitialize it.

align magnific popup to the top of the page

On a PC my Magnific popup works perfectly. However, on smaller screens the popup displays in the middle of the screen forcing the user to have to scroll down to find displayed image. Is there a way of aligning the image in the popup to the top of the page?
Have you tried the alignTop config property?
$.magnificPopup.open({
alignTop : true,
items : { /*your items here*/ }
})
http://dimsemenov.com/plugins/magnific-popup/documentation.html#aligntop

what is the use of window.open('','_self').close(); in chrome extension

When I click the extension icon, a popup is shown.
After that, when I try to click "URL restrictions", it will open a window, after that when I click the popup again, the popup is overlapping that url restriction window.
The above issue happens on Windows only, not on Linux.
So I have added window.open('','_self').close(); which apparently fixed the issue. But not exactly. Is it correct? I have referred this Link and Link2 but can not understand the meaning.
What is the purpose of window.open('','_self').close();?
EDIT: this is my popup.js
function click(e) {
var windowObj = window.open(site_exception_url, 'url_window', params);
windowObj.focus();
window.close();
window.open('','_self').close();
return false;
}
On Windows the popup isn't closed automatically after a new window is opened from a link within the popup.
Close it in the click handler manually, this won't hurt Linux but will help on Windows:
document.addEventListener("click", function(event) {
if (event.target.localName == "a") {
close();
}
});
The related questions linked in your question don't apply here as the first is for userscripts, not extensions, and the second isn't for popups shown by the browser when you click the toolbar button.

Chrome extension popup resets even after changing its contents

In my chrome extension, I had to change popup html from background. Changes affects then and after clicking again in extension icon, the unchanged popup is showing. Why?
Every time you click away from your popup window, the window is reset. A way to fix this would be to use your background page to store session data, in your popup.js, do something like this:
chrome.runtime.getBackgroundPage(function(bg){
if(bg.myDataHTML){
document.body.innerHTML = bg.myDataHTML;
}
setInterval(function(){
bg.myDataHTML = document.body.innerHTML
},1000);
//do the rest of your work here.
})
I typically do everything in my popup inside that anonymous function to give me access to the libraries defined within my background page.

Resources