-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugins): fix typing and load-order
- Loading branch information
1 parent
be78e3a
commit 01cad91
Showing
19 changed files
with
98 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ | |
!server.ts | ||
!api-server.ts | ||
!sessionReplay.ts | ||
!plugins* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import Hero, { Core } from '@ulixee/hero-fullstack'; | ||
import ExecuteJsPlugin from '@ulixee/execute-js-plugin'; | ||
|
||
Core.use(ExecuteJsPlugin); | ||
|
||
(async function main() { | ||
const hero = new Hero(); | ||
hero.use(ExecuteJsPlugin); | ||
|
||
await hero.goto('https://ulixee.org'); | ||
await hero.activeTab.waitForPaintingStable(); | ||
const divs = await hero.executeJs(() => { | ||
// @ts-ignore | ||
return window.document.querySelectorAll('div').length; | ||
}); | ||
console.log('Divs on https://ulixee.org?', divs); | ||
await hero.close(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import Hero from '@ulixee/hero-fullstack'; | ||
import { ClientPlugin } from '@ulixee/hero-plugin-utils'; | ||
|
||
export default class ClientHelloPlugin extends ClientPlugin { | ||
static readonly id = 'client-hello-plugin'; | ||
|
||
async onHero(hero, sendToCore) { | ||
console.log('Hello Hero %s', await hero.sessionId); | ||
} | ||
} | ||
|
||
(async function main() { | ||
const hero = new Hero(); | ||
hero.use(ClientHelloPlugin); | ||
|
||
await hero.goto('https://ulixee.org'); | ||
await hero.activeTab.waitForPaintingStable(); | ||
await hero.close(); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.