Skip to content

feat(injectors): add Airtable cookie consent closing injector#847

Merged
nicomiguelino merged 3 commits into
masterfrom
feat/airtable-cookie-consent-injector
Jun 19, 2026
Merged

feat(injectors): add Airtable cookie consent closing injector#847
nicomiguelino merged 3 commits into
masterfrom
feat/airtable-cookie-consent-injector

Conversation

@nicomiguelino

@nicomiguelino nicomiguelino commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

User description

Summary

  • Adds a JavaScript injector for Airtable that hides the OneTrust cookie consent banner
  • Uses CSS injection (display: none) targeting #onetrust-consent-sdk for reliability, since the banner loads asynchronously

PR Type

Enhancement


Description

  • Add Airtable cookie consent injector

  • Hide OneTrust banner using CSS


Diagram Walkthrough

flowchart LR
  injector["Airtable injector"] 
  style["Create style element"]
  css["Hide OneTrust banner"]
  head["Append to document head"]
  injector -- "creates" --> style
  style -- "contains CSS" --> css
  style -- "injects into" --> head
Loading

File Walkthrough

Relevant files
Enhancement
airtable-cookies-consent-closing.js
Airtable OneTrust consent banner CSS hider                             

javascript-injectors/examples/airtable-cookies-consent-closing.js

  • Adds a new Airtable JavaScript injector example.
  • Creates a style element at runtime.
  • Hides #onetrust-consent-sdk with display: none !important.
  • Appends the CSS to document.head.
+5/-0     

@nicomiguelino nicomiguelino self-assigned this Jun 19, 2026
@nicomiguelino nicomiguelino requested a review from Copilot June 19, 2026 21:05
@nicomiguelino nicomiguelino marked this pull request as ready for review June 19, 2026 21:05
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

PR Reviewer Guide 🔍

(Review updated until commit e0b0d12)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Possible Issue

If this injector runs at document_start before the page has created document.head, document.head.appendChild(style) will throw and the banner-hiding CSS will never be installed. Consider waiting for document.head or appending to document.documentElement as a fallback.

document.head.appendChild(style);

@github-actions

Copy link
Copy Markdown

Persistent review updated to latest commit e0b0d12

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

PR Code Suggestions ✨

Latest suggestions up to e0b0d12
Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Avoid early-load append failure

Guard against document.head being unavailable when this injector runs early in page
loading. Appending to document.documentElement as a fallback prevents the injector
from throwing before the page head exists.

javascript-injectors/examples/airtable-cookies-consent-closing.js [3-5]

 const style = document.createElement('style');
 style.textContent = '#onetrust-consent-sdk { display: none !important; }';
-document.head.appendChild(style);
+(document.head || document.documentElement).appendChild(style);
Suggestion importance[1-10]: 6

__

Why: The existing_code matches lines 3-5, and the suggestion accurately prevents a possible runtime error if document.head is not yet available. The impact is moderate because this depends on injector timing, but it is a reasonable robustness improvement.

Low

Previous suggestions

Suggestions up to commit e0b0d12
CategorySuggestion                                                                                                                                    Impact
Possible issue
Guard against missing head

If this injector runs before document.head exists, document.head.appendChild(style)
will throw and the banner will remain visible. Append to an available root element,
or defer until the DOM is ready.

javascript-injectors/examples/airtable-cookies-consent-closing.js [3-5]

 const style = document.createElement('style');
 style.textContent = '#onetrust-consent-sdk { display: none !important; }';
-document.head.appendChild(style);
+(document.head || document.documentElement).appendChild(style);
Suggestion importance[1-10]: 5

__

Why: This is a valid robustness improvement because document.head may be unavailable if the injector runs very early. The suggested fallback to document.documentElement is simple and relevant, though the issue is context-dependent rather than definitely broken.

Low

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new JavaScript injector example intended for Airtable pages that hides the OneTrust cookie consent banner by injecting CSS targeting #onetrust-consent-sdk.

Changes:

  • Add a new injector example script: airtable-cookies-consent-closing.js
  • Implement CSS-based hiding of the OneTrust banner via an injected <style> element

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread javascript-injectors/examples/airtable-cookies-consent-closing.js Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread javascript-injectors/examples/airtable-cookies-consent-closing.js Outdated
Comment thread javascript-injectors/examples/airtable-cookies-consent-closing.js
@nicomiguelino nicomiguelino merged commit 3c6be97 into master Jun 19, 2026
@nicomiguelino nicomiguelino deleted the feat/airtable-cookie-consent-injector branch June 19, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants