Skip to content

Commit

Permalink
modified: 2023-09-05-console-hack.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdyu committed Apr 15, 2024
1 parent 274f5c4 commit 93505f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions _posts/2023-09-05-console-hack.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: console hack
---

- open other site in iframe

```javascript
const ORIGIN = 'https://eloquentjavascript.net'
const FRAME_NAME = 'eljs'
Expand All @@ -28,6 +29,7 @@ if (location.origin === ORIGIN) {
```

- extract gitlab issue

```javascript
$('.issue-title-text').each((k, v) => {
var p = document.createElement('p');
Expand All @@ -37,6 +39,7 @@ $('.issue-title-text').each((k, v) => {
```

- doc-menu-outline

```javascript
(hosts => {
const {hostname} = location
Expand Down Expand Up @@ -112,6 +115,7 @@ $('.issue-title-text').each((k, v) => {
```

- medium-add-to-reading-list

```javascript
const items = document.querySelectorAll('button[aria-controls="addToCatalogBookmarkButton"]')

Expand All @@ -131,6 +135,7 @@ addToReadingList(1000)
```

- Batch clear youtube watch later

```javascript
function getContinuationItems(x) {
if (x.continuationItemRenderer) {
Expand Down Expand Up @@ -259,16 +264,19 @@ fetch("https://www.youtube.com/youtubei/v1/browse?key=AIzaSyAO_FJ2SlqU8Q4STEHLGC
```

- Expand the entire menu on the left of the vscode api documentation (展开vscode官网api文档左侧全部菜单)

```javascript
// go to https://code.visualstudio.com/api/, and execute the following code in DevTools console
$$('.panel ul').forEach(x => {x.classList.add('in')})
```
- Batch unstar github repo

```javascript
for await (x of $$('.js-toggler-container .starred button')) { await new Promise(r => setTimeout(r, 500)); x.click() }
```

- Batch unfollow twitter following(批量取消twitter关注)

```javascript
// go to https://twitter.com/[userName]/following, and execute the following code in DevTools console
(async function twtterBatchUnfollow() {
Expand Down

0 comments on commit 93505f5

Please sign in to comment.