亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

? ? ????? JS ???? Chrome ?? ???? - ?? ?? ??

Chrome ?? ???? - ?? ?? ??

Jan 06, 2025 pm 10:32 PM

?? ????? Chromium ?? ????? ???? ??? ??????, ? ????? ??? ?? TypeScript? ?? ?? ??? ???? ???? ???? ?????. ?? ??? Page Audio ?? ????? ??? ???? ????????.

??

????

Chrome extension  - implementing an extension

?? ?? ?????? ??? ?? ?? ??????. ?? ????? ???? ?? ??? ???? ???? ???? ????. ????? ???? ??? ???? ?? ??? ????.

? ? ??? ???? www.example.com? ? ? ??? ??? ????, ?? ??? ???? ????, www.example.com?? ???? ?? ????? ???. ?? www.example.com? ?? ?? ? ? ??? ?? ?? ? ? ??? ???? ?? ???? ?? ???? ?? ?? ????? ???. ?, ???? ?? ?? ?? ?? ?? ???? ????? ???.

???? ??? ?? ??

??? ??? HTMLAudioElement? ???? ???? ?? ?? ????? ?? ??/?? ???? ???.

??? ??? ??? ????? ???? ?????. ?? ???? HTMLAudioElement ??? ???? ??? ????? ?? ??? ??? ???? ??? ??? ? ????. ?? ???? ??? ?? ??? ?? ???? ??? ???? ????, ???? URL? ?? ?? ?? ???? ??? ??? ???? ?? ???? ?? ???? ??? ?? ?????.

??? ? ?? ??? ?? ???? ??? ???? ?? ? ??? ?????. HTMLAudioElement ??? ??? ?? ?? ?? ?? ????? ??/?? ??? ? ??? ?? ? ?? ????. ???? ???? ? ??? ? ???? API? ????. ?? ????? API???.

????? API? ???? ?? ????? ??? ?? HTML ?? ??? ?? ? ????. ?? ???? HTMLAudioElement? ???? ??? ? ??/?? ??? ? ?? ??? ????. ??? ??? ??? DOM ??? ??? ? ???? ??? ?? ???? ???? ????? ???? ????? ????? ??? ??? ????? ????? ?? ?????.

??

Chrome extension  - implementing an extension

Manifest.json? ??? ??

? ?? ?????? ?? ??? ? ?? ??? ?????.

  • ? - ???? ?? ?? ?/?? ?????? ??? ??? ???
  • ????? - ???? ???? ????? ????? ??? ???? ??? ?????

?????? ?? ???? ????? ?? ??? ?? ??? ?????.

?? ?? ??

?? ??? ?? ?? ??? ? ??? ???? ?? ?? ?? ?????. ????? ??? ?? ??? ?? ?? ?? ??? ?? ? ?????. ?? ??? ?? ?? ????? ?? ?? ??? ?? ??? ???? ?????? ? ?????? ? ???? ?? ?? ??? ???? ??? ?? ? ????.

????? ?? ??

?? ????? HTMLAudioElement? ??? ?? ???? ???? ???? ????. ? ????? ??? ?? ????? API? ???? ??? ??? ???? ?? ???? ???? ??? ???????.

?? ?? ?????? ??? ??? ????? ?? ??? ??? ?? OffscreenDoc ???? ?????. ????? ?? ???? ?? ?? ????? ??? ?????.

// ts/offscreen-doc.ts
/**
 * Static class to manage the offscreen document
 */
export class OffscreenDoc {
    private static isCreating: Promise<boolean | void> | null;
    private constructor() {
        // private constructor to prevent instantiation
    }

    /**
     * Sets up the offscreen document if it doesn't exist
     * @param path - path to the offscreen document
     */
    static async setup(path: string) {
        if (!(await this.isDocumentCreated(path))) {
            await this.createOffscreenDocument(path);
        }
    }

    private static async createOffscreenDocument(path: string) {
        if (OffscreenDoc.isCreating) {
            await OffscreenDoc.isCreating;
        } else {
            OffscreenDoc.isCreating = chrome.offscreen.createDocument({
                url: path,
                reasons: ['AUDIO_PLAYBACK'],
                justification:
                    'Used to play audio independently from the opened tabs',
            });
            await OffscreenDoc.isCreating;
            OffscreenDoc.isCreating = null;
        }
    }

    private static async isDocumentCreated(path: string) {
        // Check all windows controlled by the service worker to see if one
        // of them is the offscreen document with the given path
        const offscreenUrl = chrome.runtime.getURL(path);
        const existingContexts = await chrome.runtime.getContexts({
            contextTypes: ['OFFSCREEN_DOCUMENT'],
            documentUrls: [offscreenUrl],
        });
        return existingContexts.length > 0;
    }
}

????? ??? ?? ???? ???? ?? ? ??? ?????. ?? ????? ??? ??? ? ??? HTML ?? ???? ?????. ??? ???? ?? ?????.

<!-- offscreen.html -->
<script src="dist/offscreen.js" type="module"></script>

? ??? ???? ?? ??? ??? ???. ? ????? ??? ?? ???? ????, HTMLAudioElement? ????, ??? ??/?? ???? ? ?????. ??? ??? ??? ???? type="module"? ????.

??? ???? ???? ?? ??? ? ? ????.

??? ?????

????? ??? ?????? ????. JSON ??? ?? ??? ???? ???. ??? ??? ? ??? ???? ???? ? ?? ????? ??? ???? ?? ??? ?????? ??????.

// ts/audio-message.ts
export interface AudioMessage {
    /**
     * Command to be executed on the audio element.
     */
    command: 'play' | 'pause';
    /**
     * Source of the audio file.
     */
    source?: string;
}

sendMessage ???? ??? ??? ???? ??? ?? ?? ?? ?? ????, ??? ?? ???? ??? ?? ? ?? ?? ?? ??? ????.

??? ????? ??? ???

??? ??? ?? ????? '??'?? ?? ?? ?? ???? ??? ?? ??? ?? ??? ???? ??? ???. ??? ??? ??????

? ?? ???? ?? ??? ???? ???.

  • ? ?? ????? ???? ? A?? ? B? ??? ??? ? ????.
  • ?? ?? ?????? URL? ??? ??
  • ?? ?? ? - ???? ???? ?? ???? ??? ??? ?? ?? ? ?? ? ?? ?? ? ??? ???? ?? ??? ? ???? ?? ?? ???? ?????.

?? ??? ???? ????? ????? ??? ????? ?? ???? ???? ?? ?????.

? ?? ???? ?? ? ???? ???? ????? ts/Background.ts ????? ??? ????.

// ts/offscreen-doc.ts
/**
 * Static class to manage the offscreen document
 */
export class OffscreenDoc {
    private static isCreating: Promise<boolean | void> | null;
    private constructor() {
        // private constructor to prevent instantiation
    }

    /**
     * Sets up the offscreen document if it doesn't exist
     * @param path - path to the offscreen document
     */
    static async setup(path: string) {
        if (!(await this.isDocumentCreated(path))) {
            await this.createOffscreenDocument(path);
        }
    }

    private static async createOffscreenDocument(path: string) {
        if (OffscreenDoc.isCreating) {
            await OffscreenDoc.isCreating;
        } else {
            OffscreenDoc.isCreating = chrome.offscreen.createDocument({
                url: path,
                reasons: ['AUDIO_PLAYBACK'],
                justification:
                    'Used to play audio independently from the opened tabs',
            });
            await OffscreenDoc.isCreating;
            OffscreenDoc.isCreating = null;
        }
    }

    private static async isDocumentCreated(path: string) {
        // Check all windows controlled by the service worker to see if one
        // of them is the offscreen document with the given path
        const offscreenUrl = chrome.runtime.getURL(path);
        const existingContexts = await chrome.runtime.getContexts({
            contextTypes: ['OFFSCREEN_DOCUMENT'],
            documentUrls: [offscreenUrl],
        });
        return existingContexts.length > 0;
    }
}

????? ???? ToggleAudio ??? ?? ?????. ??, ????? ??? ?????. ??? ?? ??? ?? ?? ??? ???? ???? ?? ? ???? ?? ?????. ?? ?? ?? ?? URL? ?? "??" ?? "?? ??" ??? ??? ??? ?????. ????? ???? ????. ?? ????? sendMessage?? ?? ??(sendMessage)? ???? ??? ??? ???? ?? ?? ??? TS? ??? ??? ??? AudioMessage ???? ???? ? ??? ???.

??? ?? ? ?? ??? ?????. ??? ????? ???? ????? ?????.

????? ??? ??? ??

??? ???? ???? ?? ???? ?? ??? ??????

?? ???? offscreen.html?? ???? ????? ???? ???. dist/offscreen.js??? ?? ts/offscreen.ts? ??? ????.

<!-- offscreen.html -->
<script src="dist/offscreen.js" type="module"></script>

??? ???, HTMLAudioElement? ???? ?? ?? ??? ??? ???? ??? ?? ??/?? ?????. ??? ???? ???? ?? ??? ?????. ??? ?? ?? ??? ??? ??? ??? ?????

??

Chrome extension  - implementing an extension

?? ????! www.example.com(?? ??? ????)?? ???? ???? ????? ?????. ?? ??? ??? ?? ???? ???? ?? ????? ?????.

??? ??? ????? ?? ????? ??? 30? ?? ?? ???? ?? ????? ?? ?????! ?? ?? ? ?? ??? ??? ????.

??? ? ?? ?????:

  • ????? ??? ???? ? ??? ?????? ? ??? ???? ?????.json? ????????
  • ??? ??? ?? ??? ???? ????? ??? ?? ????? ??? ??? ???? ????
  • ??? ????? ???? ?? ????? ??? DOM? ???? ??????? ?? ??? ??? ??????

???? ???? ???? ????! ? ?? ?????? ???? ?? ?? ????? ???? ? ????? ?? ?? ???? ??? ? ??? ?? ?? ????? ??? ????. ??? ?? ? ??? ???? ? ?? ??? ???? ?? ???? ???????.

???? ????? ?????!

? ??? Chrome ?? ???? - ?? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

??? ????
1597
29
PHP ????
1488
72
???
node.js?? HTTP ????? ??? node.js?? HTTP ????? ??? Jul 13, 2025 am 02:18 AM

Node.js?? HTTP ??? ???? ? ?? ???? ??? ????. 1. ?? ????? ????? ??? ??? ? ?? ????? ?? ?? ? https.get () ??? ?? ??? ??? ? ?? ????? ?? ??? ?????. 2.axios? ??? ???? ? ?? ??????. ??? ??? ??? ??? ??? ??? ???/???, ?? JSON ??, ???? ?? ?????. ??? ?? ??? ????? ?? ????. 3. ?? ??? ??? ??? ??? ???? ???? ??? ??? ???? ?????.

JavaScript ??? ?? : ?? ? ?? JavaScript ??? ?? : ?? ? ?? Jul 13, 2025 am 02:43 AM

JavaScript ??? ??? ?? ?? ? ?? ???? ????. ?? ???? ???, ??, ??, ?, ???? ?? ? ??? ?????. ?? ????? ?? ?? ? ? ??? ????? ?? ??? ??? ????. ??, ?? ? ??? ?? ?? ??? ??? ??? ???? ??? ??? ???? ??? ?? ??? ????. ?? ? ????? ??? ???? ? ??? ? ??? TypeofNull? ??? ?????? ??? ? ????. ? ? ?? ??? ???? ?????? ????? ???? ??? ???? ? ??? ? ? ????.

REACT vs Angular vs Vue : ?? JS ??? ??? ?? ????? REACT vs Angular vs Vue : ?? JS ??? ??? ?? ????? Jul 05, 2025 am 02:24 AM

?? JavaScript ??? ??? ??? ?????? ?? ??? ?? ?? ??? ?? ???? ????. 1. ??? ???? ???? ?? ??? ?? ? ? ???? ??? ??? ?? ? ?? ????? ?????. 2. Angular? ?????? ??? ?? ???? ? ?? ?? ??? ??? ??? ???? ?????. 3. VUE? ???? ?? ??? ???? ?? ?? ??? ?????. ?? ?? ?? ??, ? ??, ???? ???? ? SSR? ???? ??? ??? ??? ???? ? ??? ?????. ???, ??? ??? ??? ????? ????. ??? ??? ??? ??? ?? ????.

JavaScript Time Object, ??? Google Chrome? EACTEXE, ? ?? ? ???? ?????. JavaScript Time Object, ??? Google Chrome? EACTEXE, ? ?? ? ???? ?????. Jul 08, 2025 pm 02:27 PM

?????, JavaScript ???! ?? ? JavaScript ??? ?? ?? ?????! ?? ?? ??? ??? ??? ? ????. Deno?? Oracle? ?? ??, ??? JavaScript ?? ??? ????, Google Chrome ???? ? ??? ??? ???? ?????. ?????! Deno Oracle? "JavaScript"??? ????? Oracle? ?? ??? ??? ??????. Node.js? Deno? ??? ? Ryan Dahl? ??? ?????? ???? ????? JavaScript? ??? ???? Oracle? ????? ???? ?????.

?? ??? : JavaScript? ??, ?? ?? ? ?? ????? ?? ??? : JavaScript? ??, ?? ?? ? ?? ????? Jul 08, 2025 am 02:40 AM

??? JavaScript?? ??? ??? ?????? ?? ???????. ?? ??, ?? ?? ? ??? ??? ?? ????? ????? ?????. 1. ?? ??? ??? ????? ???? ??. ()? ?? ??? ??? ?????. ?. ()? ?? ??? ?? ??? ??? ?? ? ? ????. 2. ?? ??? .catch ()? ???? ?? ??? ??? ?? ??? ??????, ??? ???? ???? ????? ??? ? ????. 3. Promise.all ()? ?? ????? (?? ?? ?? ? ??????? ??), Promise.Race () (? ?? ??? ?? ?) ? Promise.AllSettled () (?? ??? ???? ??)

?? API? ???? ??? ???? ??? ?????? ?? API? ???? ??? ???? ??? ?????? Jul 08, 2025 am 02:43 AM

Cacheapi? ?????? ?? ???? ??? ???? ???, ?? ??? ??? ?? ???? ? ??? ?? ? ???? ??? ??????. 1. ???? ????, ??? ??, ?? ?? ?? ???? ???? ??? ? ????. 2. ??? ?? ?? ??? ?? ? ? ????. 3. ?? ?? ?? ?? ?? ??? ??? ?? ?????. 4. ??? ???? ?? ?? ???? ?? ?? ?? ?? ?? ???? ?? ?? ??? ??? ? ????. 5. ?? ???? ??, ??? ??? ? ??? ??, ?? ??? ? ?? ???? ???? ???? ? ?? ?????. 6.?? ??? ?? ?? ?? ??, ???? ?? ? HTTP ?? ????? ?????? ???????.

??? ??. ?? ????? ??? ????? ??? ?? ?? ??? ??. ?? ????? ??? ????? ??? ?? ?? Jul 06, 2025 am 02:36 AM

.map (), .filter () ? .reduce ()? ?? JavaScript ?? ?? ???? ??? ??? ??? ? ? ????. 1) .map ()? ??? ??? ??? ???? ? ??? ???? ? ?????. 2) .filter ()? ???? ??? ????? ? ?????. 3) .reduce ()? ???? ?? ??? ???? ? ?????. ???? ??? ????? ??? ?? ?? ??? ?????.

JS Roundup : JavaScript ??? ??? ?? ?? ??? JS Roundup : JavaScript ??? ??? ?? ?? ??? Jul 08, 2025 am 02:24 AM

JavaScript? ??? ??? ?? ??, ? ? ? ?? ???? ???? ??? ??? ?????. 1. ?? ??? ?? ??? ???? ??? ??? ??? ??? ?? WebAPI? ?????. 2. WebAPI? ??????? ??? ?? ? ? ??? ?? ??? (??? ?? ?? ???? ??)? ????. 3. ??? ??? ?? ??? ?? ??? ?????. ?? ??? ??? ????? ??? ??? ?? ? ???? ?????. 4. ???? ?? (? : Promise. 5. ??? ??? ???? ?? ???? ???? ?? ?? ?? ??? ????? ? ??????.

See all articles