Hirdetés

Keresés

Új hozzászólás Aktív témák

  • Sk8erPeter

    nagyúr

    válasz spammer #2938 üzenetére

    Pl. Chrome extensionnél meghatározhatod, mikor kerüljön injektálásra a JS-fájl, lásd a run_at részt:
    https://developer.chrome.com/extensions/content_scripts

    "In the case of "document_start", the files are injected after any files from css, but before any other DOM is constructed or any other script is run.

    In the case of "document_end", the files are injected immediately after the DOM is complete, but before subresources like images and frames have loaded.

    In the case of "document_idle", the browser chooses a time to inject scripts between "document_end" and immediately after the window.onload event fires. The exact moment of injection depends on how complex the document is and how long it is taking to load, and is optimized for page load speed.

    Note: With "document_idle", content scripts may not necessarily receive the window.onload event, because they may run after it has already fired. In most cases, listening for the onload event is unnecessary for content scripts running at "document_idle" because they are guaranteed to run after the DOM is complete. If your script definitely needs to run after window.onload, you can check if onload has already fired by using the document.readyState property."

    De neked a css lesz az érdekes, beszúrhatsz saját CSS-t, így pl. adott elemre vonatkozó display:none-t:
    css:
    Optional. The list of CSS files to be injected into matching pages. These are injected in the order they appear in this array, before any DOM is constructed or displayed for the page.

Új hozzászólás Aktív témák