> ## Content Index
> Fetch the complete content index at: https://www.oransblog.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# weird javascript hacks
- URL: https://www.oransblog.com/javascript-hacks/
- Published: 2021-12-26T05:10:26.000Z
- Updated: 2026-10-29T05:56:57.000Z
- Author: Oran C
- Tags: #Import 2026-11-12 01:14

here's a weird javascript stuff I've found and/or built while on my many rabbit wholes into the webs weird and wacky world of working with browsers! 

# Console.log( Gif)? wait...what?  

## lets start simple

# level 1 

### lets set some style on our console.log!

```javascript
console.log("Multiple styles: %cred %corange", "color: red", "color: orange", "Additional unformatted message");
```

![](https://www.oransblog.com/content/images/2021/12/image-2.png)

## okay well thats neet and all but what does that have to do with gifs?   
  
well hold your horses im getting there

## Level 2: Console pirates

```javascript
console.log('%c ARRRR Ima console pirate!', "background: #222; color: red; font-size: 20px;   0 0;");
```

![](https://www.oransblog.com/content/images/2021/12/image-4.png)

### so if i can add arbitary css? well what could i do now...

## what about an image

# Level 3: 

## Load an image into the devtools log???

![](https://www.oransblog.com/content/images/2021/12/image-3.png)

WHAT?

## WAT?

### yes that works, just wow.

# 

## Okay, images no problem,...so whats next?

## What about image tiling? 🤔

Sure...

```javascript
console.log('%c Oh my heavens! ', "background: #222; color: [[bada55]]; font-size: 100px;  background: url('https://picsum.photos/100/100') 0 0;");
```

# Yep.

![](https://www.oransblog.com/content/images/2021/12/image-5.png)

# 

## Okay thats nice and all but what about gifs? 

# Level 3: GIFS!

```javascript
console.log('%c Never...', "background: #222; color: [[bada55]]; font-size: 100px;  background: url('https://emojis.slackmojis.com/emojis/images/1539890226/4845/rickroll.gif?1539890226') 0 0;");
```

![](https://www.oransblog.com/content/images/2021/12/image-6.png)

a little more zoomed in..

```javascrip
console.log('%c Never...', "background: #222; color: [[bada55]]; font-size: 100px;  background: url('https://bit.ly/3ne3gaQ') 0 0; background-size: 100% auto;");

```

![](https://www.oransblog.com/content/images/2021/12/image-7.png)

Better

---

# Browser Popup window Flappy bird! 

This next one is both equally WHAT?! and amazing

its flappy bird made using major abuse of the popup window api in browsers

![](https://www.oransblog.com/content/images/2021/12/image-8.png)

Made by [Charlie Gerard](https://twitter.com/devdevcharlie?ref=oransblog.com)

![](https://www.oransblog.com/content/images/2021/12/qdLrDBwG_x96.jpg)

Charlie Gerard

Link to website

[Flappy Bird game with browser windows](https://flappy-windows.netlify.app/?ref=oransblog.com)

## HOW!?!?!? 

### how does this wizardry work?  

![](https://www.oransblog.com/content/images/2021/12/image-10.png)

### they (maybe she? idk ill use they to be safe) open up a window using `window.open(...)`

![](https://www.oransblog.com/content/images/2021/12/image-11.png)

And use the `screenX=${resolutionWidth - 100}` to dynamically set the start location of the flappy bird pipes! 

## but heres the trick part!

### how does jumping with keyboard work???

![](https://www.oransblog.com/content/images/2021/12/image-13.png)

the code checks if the space bar was pressed

![](https://www.oransblog.com/content/images/2021/12/image-14.png)

then is this function is called every time you press the space bar!

![](https://www.oransblog.com/content/images/2021/12/image-12.png)

## Last last question is how do they update the position of the bird? and handle button input across windows? 

![](https://www.oransblog.com/content/images/2021/12/image-15.png)

Full source code is found here  
[https://flappy-windows.netlify.app/index.js](https://flappy-windows.netlify.app/index.js?ref=oransblog.com)

### last note: i love how easy the code is to read, very well done interms of simplicty! 

---

# Scrolling Tabname

![](https://www.oransblog.com/content/images/2021/12/image-9.png)

this is on of my older projects but i was wondering what it would look like if you could have the tab name change dynamically! anser is this project!

Click "set tab name" after you enter some text into 'input' and the tab scrolling text changes!

[https://p5-scrolling-browser-tab-name.surge.sh/](https://p5-scrolling-browser-tab-name.surge.sh/?ref=oransblog.com)

---

![](https://www.oransblog.com/content/images/2021/12/image-27.png)

# add any tags to the dom

I found this weird tag feature in a popup chat within a website

![](https://www.oransblog.com/content/images/2021/12/image.png)

what????

## but how do i add my own weird html tags?

## what about `<oraly></orly>` ?

```JavaScript
document.getElementsByTagName("body")[0].appendChild(document.createElement("orly"))
```

### Presto!

![](https://www.oransblog.com/content/images/2021/12/image-1.png)

I didnt know you could do this stuff, html is well a `bit weird`

![](https://media2.giphy.com/media/67skGz7YlLW9C229Yf/giphy.gif)

# Read more cool stuff!

For more fun and weird content checkout my other blog posts about javascript and other things!

Recommended Javascript posts:

[Hidden Javascript featuresHere are some uncommon or little known used javascript features const b = template\` wait what? \`![](https://www.oransblog.com/favicon.png)Oran's BlogOran C![](https://mxstbr.blog/img/logargs-explanation.png)](https://www.oransblog.com/javascript/)

[Little-known javascript “window” functionsMy Deep dive into the browsers global “window” object. Journey:I was interested to see what all the functions were on the global window object. Object.getOwnPropertyNames(window).map(x =&gt; { try{ console.log(x, window\[x\]) }catch(e){ console.log(&quot;NOT FOUND&quot;) } }) Example outputFavorite fi…![](https://www.oransblog.com/favicon.png)Oran's BlogOran C![](https://www.oransblog.com/content/images/2021/12/image-20.png)](https://www.oransblog.com/javascript-window/)

---

---

![](https://www.oransblog.com/content/images/2021/12/oran.jpg) 

# Author

by oran collins  
github.com/wisehackermonkey  
![](https://www.oransblog.com/content/images/2021/12/image-16.png)  
20211225