Issue attempting to listen for “user input” events on a webpage that has content

I am developing a Chrome extension at the moment, and one of its main features is to trigger specific checks upon detecting user typing in input and textarea elements.

My code works fine on normal pages, but while testing, I recently encountered an issue of the code not detecting the input, if the input field in question is being loaded via a frame tag.

How can I rectify that? Here is my attempt at fixing it, but it doesn’t seem to be working. No errors either.

// Helper function to add an input event listener to a given document
function addInputListener(doc) {
    doc.addEventListener('input', function(event) {
        if ((event.target.tagName === 'INPUT' || event.target.tagName === 'TEXTAREA') && !domainCheckTriggered) {
            domainCheckTriggered = true; // Ensure this runs only once
            checkDomain(); // Call the function when input is detected
        }
    }, true); // Use capture phase to ensure it catches early
}

// Attach listener to the main document
addInputListener(document);

// Function to handle frames (for <frame> inside <frameset>)
function handleFrame(frame) {
    try {
        const frameDoc = frame.contentDocument || frame.contentWindow.document;
        if (frameDoc) {
            addInputListener(frameDoc); // Attach the event listener to the frame's document
            console.log("Input listener added to frame:", frame.src);
        } else {
            console.warn("Could not access frame content:", frame.src);
        }
    } catch (error) {
        console.error('Error accessing frame content:', error);
    }
}

// Attach listeners to any frames that exist on page load
if (document.frames) {
    for (let i = 0; i < document.frames.length; i++) {
        handleFrame(document.frames[i]);
    }
}

// Listen for dynamically added frames (if they can be added dynamically in your case)
const observer = new MutationObserver(function(mutations) {
    mutations.forEach(mutation => {
        mutation.addedNodes.forEach(node => {
            if (node.tagName === 'FRAME') {
                handleFrame(node);
            }
        });
    });
});

// Start observing the document for changes (e.g., dynamically added frames)
observer.observe(document.body, { childList: true, subtree: true });

manifest.json

{
  "manifest_version": 2,
  "name": "Tempest",
  "version": "1.0",
  "icons": {
    "16": "icons/tempest_16.png",
    "48": "icons/tempest_48.png",
    "128": "icons/tempest_128.png"
  },

  "browser_action": {
    "default_icon": {
      "16": "icons/tempest_16.png",
      "24": "icons/tempest_48.png",
      "32": "icons/tempest_128.png"
    }
  },
  "permissions": [
    "tabs",
    "pageCapture",
    "activeTab",
    "storage",
    "<all_urls>"
  ],
  "background": {
    "scripts": ["scripts/jszip.min.js", "background.js"],
    "persistent": false
  },
  "content_scripts": [
    {
      "matches": ["http://*/*", "https://*/*"],
      "js": ["content.js"],
      "run_at": "document_idle"
    }
  ],
  "web_accessible_resources": [
    "whitelist.txt",
    "UI/welcome.html",
    "UI/register.html",
    "UI/login.html"
  ],

  "options_page": "UI/welcome.html"
}

Prisma migration error: “type “serial” does not exist” despite using PostgreSQL 15

I’m trying to run a migration in my Prisma project, but I’m encountering the error “type “serial” does not exist”, even though I’m using PostgreSQL 15.8, which should support this data type.

Steps I’ve taken:

I’ve ensured that I’m using the latest version of Prisma Client (@prisma/client: “5.11.0”).
I’ve checked my PostgreSQL version (psql -V), which is PostgreSQL 15.8.
I’ve cleared the Prisma cache by deleting the node_modules and prisma directories and then reinstalling dependencies (npm install).
I’ve tried manually executing the SQL migration in the PostgreSQL console, but I still encounter the error.
I don’t have any additional PostgreSQL extensions installed (dx only shows plpgsql).
My migration file:

-- AlterTable
ALTER TABLE "ClosedPositions" DROP CONSTRAINT "ClosedPositions_pkey",
ALTER COLUMN "id" SET DATA TYPE SERIAL,
ADD CONSTRAINT "ClosedPositions_pkey" PRIMARY KEY ("id");

-- AlterTable
ALTER TABLE "OpenPositions" DROP CONSTRAINT "OpenPositions_pkey",
ALTER COLUMN "id" SET DATA TYPE SERIAL,
ADD CONSTRAINT "OpenPositions_pkey" PRIMARY KEY ("id");
Error: P3006

Migration `20240920182327_change_id_to_int_in_positions` failed to apply cleanly to the shadow database. 
Error:
ERROR: type "serial" does not exist
   0: sql_schema_connector::validate_migrations
           with namespaces=None
             at schema-engine/connectors/sql-schema-connector/src/lib.rs:325
   1: schema_core::state::DevDiagnostic
             at schema-engine/core/src/state.rs:276

What could be causing this error, and how can I resolve it? Is there a conflict or configuration issue that’s preventing Prisma from correctly recognizing the serial data type?

I’ve also tried

 npx prisma migrate reset

and I get error:

Error: P3018

A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve

Migration name: 20240920182327_change_id_to_int_in_positions

Database error code: 42704

Database error:
ERROR: type "serial" does not exist

DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E42704), message: "type "serial" does not exist", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("parse_type.c"), line: Some(274), routine: Some("typenameType") }

many thanks for any help

Div doesn’t occupy space in mobile

I have a div with three elements: input field, timer, reset button in desktop view all three elements are of the same height but when I view it on an iphone 12 mini specifically the timer and reset button shrink in height. When I tested its dimensions using chrome dev tools this issue didn’t come up

enter image description here

<div style={{ display: "flex", flexDirection: 'row', justifyContent: 'space-between', height: '8vh', alignItems: 'center', }}>
                    <input
                        type="text" autoCorrect="off" autoCapitalize="none"
                        ref={inputRef}
                        value={typedWord}
                        onChange={handleInputChange}
                        disabled={timer ? false : true}
                        autoFocus={true}
                    />
                    <div className="timer">
                        <span style={{
                            fontSize: 20, fontFamily: 'lexend', color: 'var(--text-color)',
                        }}>{timer}s</span>
                    </div>
                    <div className="reset" onClick={() => {
                        setRotated(!rotated);
                        resetTest();
                        setTypedChars([]);
                        setTest(false)
                    }}>
                        <FiRefreshCcw size={25} color={'var(--text-color)'} className={rotated ? 'icon rotate' : 'icon'} />
                    </div>
                </div>

input {
  background-color: var(--sub-alt-color);
  border: 1px solid var(--sub-color);
  color: var(--text-color);
  border-radius: 5px;
  padding-left: 20px;
  width: 65.5%;
  max-width: 65.5%;
  min-height: 8vh;
  height: 8vh;
  font-size: 18px;
  outline: none;
  transition: border-color 0.3s ease;
}

.timer {
  width: 14.5%; display: flex; user-select: none; height: 8vh; min-height: 8vh; flex-shrink: 0; align-items: center; justify-content: center; background-color: var(--sub-alt-color); border-radius: 5px;
}
.reset {
  width: 14.5%; display: flex; height: 8vh; align-items: center; min-height: 8vh; flex-shrink: 0; justify-content: center; background-color: var(--sub-alt-color); border-radius: 5px;
  cursor: pointer;
}

Tooltip for a 2 dataset doughnut chart is being presented when mouse’s rover is out of the dataset placement

I have a doughnut chart implemented with Chart.js 4.4.1. This chart has 2 datasets, one in an outside dataset doughnut, and the other one in the inside dataset doughnut.

Each dataset has his own tooltip. And the tooltip should be presented only when the mouse is rovering on top of the respective dataset.

But this is not what always happens, as shown in the images and GIF below. If I move the mouse on top of the dataset, without leave it, the tooltip is changing the presented data from one dataset to another.

Mouse hovering on inside dataset, presenting outside dataset's tooltip.

Mouse hovering on outside dataset, presenting inside dataset's tooltip.

Mouse hovering example.

The problem also happens when the mouse is hovering in other positions out of the respective dataset.

The chart code:

chart_pie_sistemas = new Chart(ctx_chart_pie_sistemas, {
    type: "doughnut",
    data: {
        labels: ['Cherwell Service Management - Atendentes', 'SZ.Chat - Omni Channel', 'Google Chat'],
        datasets: [
            {
                label: "Sistema",
                data: [10953, 6332, 0],
                backgroundColor: ['#F16A6A', '#2196F3', '#0F9D58'],
            },
            {
                label: "UI",
                data: [0, 0, 17285],
                backgroundColor: ['#F16A6A', '#2196F3', '#0F9D58'],
            },
        ]
    },
    options: {
        locale: 'pt-BR',
        responsive: true,
        interaction: {
            intersect: false,
            mode: 'dataset',
        },
        plugins: {
            legend: {
                display: true,
                position: 'top',
            },
            title: {
                display: true,
                text: 'Notificações por sistema e UI',
                font: {
                    size: 24,
                }
            },
            tooltip: {
                filter: function(context) {
                    var valor = context.dataset.data[context.dataIndex];
                    return valor > 0;
                },
                callbacks: {
                    footer: function(context) {
                        let sum = 0;
                        var contador = 0;
                        context.forEach(function(tooltipItem) {
                            contador++;
                            sum += tooltipItem.parsed;
                        });
                        var total_texto = (contador > 1 ? 'Total: ' + formatLocale(sum) : "");
                        return total_texto;
                    }
                }
            },
        }
    }
});

Please, refer to this jsfiddle to test the code.

Is it possible to configure this chart to display the correct tooltip, according the mouse hovers placement in the respective dataset?

Highcharts organizational chart export font size

I am using highcharts to renderorganizational chart for our company and in my web browser it works fine but when I export to pdf i loose text in my nodes.
I have tried numerous approaches with no luck.
This is my fiddle:

Highcharts.chart('container', {
    chart: {
        height: 200,width:400,
        inverted: true
    },

    title: {
        text: ' Ledning'
    },

    accessibility: {
        point: {
            descriptionFormat: '{add index 1}. {toNode.name}' +
                '{#if (ne toNode.name toNode.id)}, {toNode.id}{/if}, ' +
                'reports to {fromNode.id}'
        }
    },
  plotOptions: { 
    series: { 
      cursor: 'pointer',
      point: { 
        events: { 
          click: function() {
            location.href = 'http://google.com';
          }
        }
      }
    }
  },

    series: [{
        type: 'organization',
        name: 'Factory',
        keys: ['from', 'to'],
        nodes: [
                {id: 'AAA', title:'Important person 1', name: 'John Doe',width:120, height:100},
                {id: 'BBB', title:'Important person 2', name: 'Jane Doe',width:120, height:100},
                {id: 'CCC', title:'Important person 3', name: 'Matt Black',width:120, height:100},
                {id: 'DDD', title:'Important person 4', name: 'Millie Liter',width:120, height:100},
                {id: 'EEE', title:'Important person 5', name: 'Nick Some',width:120, height:100},
                {id: 'FFF', title:'Important person 6', name: 'Wednesday Parker Hutchinson',width:120, height:100},
                {id: 'GGG', title:'Important person 7', name: 'Wendy McDonald',width:120, height:100},
                {id: 'HHH', title:'Important person 8', name: 'Natalie Porter',width:120, height:100},
                {id: 'III', title:'Important person 9', name: 'Sir Donald Ravensburger',width:120, height:100},
                {id: 'JJJ', title:'Important person 10', name: 'Mick Dundee',width:120, height:100},
                {id: 'KKK', title:'Important person 10', name: 'Nicki Wicki',width:120, height:100},
        ],      
        data: [
            ['KKK','FFF'],
            ['KKK','JJJ'],
            ['KKK','BBB'],
            ['KKK','III'],
            ['KKK','EEE'],
            ['KKK','DDD'],
            ['KKK','CCC'],
            ['KKK','GGG'],
            ['KKK','AAA'],
            ['KKK','HHH'],
        ],
        levels: [{
            level: 0,
            color: 'silver',
            dataLabels: {
                color: 'black'
            },
            height: 25
        }, {
            level: 1,
            color: 'blue',
            dataLabels: {
                color: 'white'
            },
            height: 25
        }, {
            level: 2,
            color: 'blue',
            dataLabels: {
                color: 'white'
            },
        }, {
            level: 3,
            color: 'blue',
            dataLabels: {
                color: 'white'
            },
        }, {
            level: 4,
            color: 'blue'
        }],     
        colorByPoint: false,
        layout: 'hanging',
        color: '#007ad0',
        dataLabels: {
            color: 'white', style : { fontSize:'25px' }
        },
        borderColor: 'white',
        nodeWidth: 'auto'
    }],
    tooltip: {
        outside: true
    },
    exporting: {
        enabled: true,
        allowHTML: true,
            menuItemDefinitions: {
                downloadPDF: {
                        onclick: function() {
                            this.exportChart({
                                    type: 'application/pdf',
                                    width: null
                            });
                        },
                }
            },
        sourceWidth: 2000,
        sourceHeight: 700,
        chartOptions: {
             nodes: {
                     width: '400px',
                 title: {
                     style: {
                         fontSize:'8px'
                     }
                 },
                 name: {
                     style: {
                         fontSize:'8px'
                     }
                 }
             }
        }
    }
});

(https://jsfiddle.net/pju2bfg7/)
Sorry about the formatting for the web view, I had to squeez to reach the export menu in fiddle, the format is not important it is the export to pdf that is important.
Have anyone been able to change the font size for the nodes text when exporting?

/R

I have tried using exporting.chartOptions without any luck!

failed installing opencv4node

i would want to make a node.js project with opencv but i failed to install opencv4node. Can someone help me please .Here are the errors I encountered

i tried installing chocolatey, i saw it in someone’s answer ‘s post but it doesn’t work

npm install --save opencv4nodejs --build-from-source
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm warn deprecated [email protected]: This package is no longer supported.
npm error code 1
npm error path D:Local DiskstageL3backendnode_modulesopencv4nodejs
npm error command failed
npm error command C:Windowssystem32cmd.exe /d /s /c node ./install/install.js
npm error info install using lib dir: D:/Local Disk/stageL3/backend/node_modules/opencv-build/opencv/build/lib/Release
npm error D:Local DiskstageL3backendnode_modulesopencv4nodejsinstallinstall.js:37
npm error   throw new Error('library dir does not exist: ' + libDir)
npm error   ^
npm error
npm error Error: library dir does not exist: D:/Local Disk/stageL3/backend/node_modules/opencv-build/opencv/build/lib/Release
npm error     at Object.<anonymous> (D:Local DiskstageL3backendnode_modulesopencv4nodejsinstallinstall.js:37:9)
npm error     at Module._compile (node:internal/modules/cjs/loader:1469:14)
npm error     at Module._extensions..js (node:internal/modules/cjs/loader:1548:10)
npm error     at Module.load (node:internal/modules/cjs/loader:1288:32)
npm error     at Module._load (node:internal/modules/cjs/loader:1104:12)
npm error     at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
npm error     at node:internal/main/run_main_module:28:49
npm error
npm error Node.js v20.17.0

Next.js how do I style a volume slider created using range:input in nextjs (typescript, tailwind)

WHERE I USED MY RANGE INPUT AS VOLUME SLIDER

<RangeInput
 min={0}
 max={1}
 step="any"
 value={volume}
 onChange={(e: BaseSyntheticEvent) => {
  if (video) {
   setVolume(e.target.valueAsNumber);
   video.volume = e.target.valueAsNumber;
   handleVolumeLevel();
  }
  }}
 onClick={handleVolumeBarClick}
 ref={volumeBarContainerRef}
 containerClassName={showVolume ? "w-16 scale-x-100" : "w-0 scale-x-0"}
 // containerWidth={64}
/>

WHERE I SET UP MY RANGE INPUT FOR ANY INPUT SLIDER

import React, { BaseSyntheticEvent, RefObject } from 'react';

interface RangeInputProps {
    min?: number;
    max?: number;
    value: number;
    step?: string;
    onChange?: (e: BaseSyntheticEvent) => void;
    containerClassName?: string;
    className?: string;
    onClick?: (e: React.MouseEvent<HTMLInputElement>) => void;
    ref?: RefObject<HTMLInputElement>
}

export const RangeInput: React.FC<RangeInputProps> = ({
    min = 0,
    max = 100,
    value,
    step,
    onChange,
    containerClassName, //set the width of the container and optionally the scale
    className,
    onClick,
    ref,
}) => {

    return (
        <>
            <div className={`grid items-center ${containerClassName} transition-all duration-150 ease-in-out transform-origin-left focus-within:w-16 focus-within:scale-x-100`}>
                <input
                    type="range"
                    min={min}
                    max={max}
                    value={value}
                    step={step}
                    onChange={onChange}
                    className={`${className} w-full rounded-lg`}
                    onClick={onClick}
                    ref={ref}
                />
            </div>
        </>
    );
};

MY CSS FOR ALL RANGE INPUT

input[type="range"] {
    width: 100%;
    height: max-content;
    appearance: none;
    cursor: pointer;
    border: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    background-color: #fff;
    height: 2px;
    border-radius: 50px;
}

input[type="range"]::-moz-range-track {
    background-color: #fff;
    height: 2px;
    border-radius: 50px;
}

input[type="range"]::-webkit-slider-runnable-track:hover {
    height: 3px;
    border-radius: 50px;
}

input[type="range"]::-moz-range-track:hover {
    height: 3px;
    border-radius: 50px;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    background-color: #5229E1;
    height: 10px;
    width: 10px;
    border-radius: 100%;
    margin-top: -4px;
}

input[type="range"]::-moz-range-thumb {
    background-color: #5229E1;
    height: 10px;
    width: 10px;
    border-radius: 100%;
}

an image of my slider

I was trying to customize my volume slider. It works fine but I want to make the background to the left side of the thumb purple and the background to the right side of the thumb white as it is. More details in the image.

Tanstack Data Table keeps resetting pagination

I have a table from @tanstack/react-table I want to implement pagination however, the pagination page looks like it keeps resetting to 0.

CODE

"use client";

import { memo, useEffect, useMemo, useState } from "react";

import {
  flexRender,
  getCoreRowModel,
  getPaginationRowModel,
  useReactTable,
} from "@tanstack/react-table";

import {
  Table,
  TableBody,
  TableCell,
  TableHead,
  TableHeader,
  TableRow,
} from "@/components/ui/table";

import PaginationFooter from "./pagination-footer";

import { createClient } from "@/utils/supabase/client";

function DataTable({ columns }) {
  const [mounted, setMounted] = useState(false);
  const [data, setData] = useState([]);
  const [count, setCount] = useState(0);
  const [rowSelection, setRowSelection] = useState({});
  const [pagination, setPagination] = useState({
    pageIndex: 0,
    pageSize: 15,
  });

  const table = useReactTable({
    data,
    columns,
    getCoreRowModel: getCoreRowModel(),
    onRowSelectionChange: setRowSelection,
    pageCount: Math.ceil(count / pagination.pageSize),
    onPaginationChange: setPagination,
    getPaginationRowModel: getPaginationRowModel(),
    state: {
      rowSelection,
      pagination,
    },
  });

  const supabase = createClient();

  useEffect(() => {
    setMounted(true);
  }, []);

  useEffect(() => {
    async function fetchData() {
      const from = pagination.pageIndex * pagination.pageSize;
      const { data, count, error } = await supabase
        .from("contacts")
        .select("*", { count: "exact" })
        .order("created_at", { ascending: false })
        .range(from, from + pagination.pageSize - 1);

      if (error) {
        return;
      } else {
        setCount(count);
        setData(data);
      }
    }
    fetchData();
  }, [pagination.pageIndex]);

  useEffect(() => {
    const selectedRows = table.getSelectedRowModel().rows.map((row) => row.original);
    console.log(selectedRows);
  }, [rowSelection]);

  if (!mounted) return null;

  return (
    <div className="h-full flex flex-col flex-1 overflow-x-auto">
      <div className="flex-grow overflow-x-auto min-h-0">
        {...table}
      </div>
      <div className="select-none bg-background">
        <PaginationFooter table={table} />
      </div>
    </div>
  );
}

export default memo(DataTable);

Is it possible to get a CSS Selector from an existing node in Puppeteer?

I have a pretty simple use case here, I need to go through a table of elements and click on each one, and enter a value.

In the browser environment, you can call the QuerySelector on document, and any node. So you can do something easily like :

const list = document.querySelectorAll('.rows')

And then query elements from each row with

list.map(el => { 
    el.querySelector('.thing_1').click();
    el.querySelector('.thing_2').click();
    el.querySelector('.thing_3').click();
})

I’m using the list element el as the root of the QuerySelector to get the 2nd level elements.

So now I’m in a situation where the Javascript Click function does not work correctly, and I need to mouse click. In puppeteer I believe you need to do this by calling the page.click() method, which Page is not available in the Browser level context (ie: within page.evaluate() or $$eval() )

I know I can get the elements of the nodes the same way as QuerySelectorAll with the const list = page.$$('.rows') function, But once I have that, How do I iterate through them to query the 2nd level elements FROM the node as the root element of the next query? Is it even possible in the puppeteer context?

As you might guess, you can’t just go

page.click('.thing_1'); 

Because that query will just give you the thing_1 of the First Row, and there’s not really a good way to query select the current row besides using the existing element node. Ideally you’d like to css query in the same way to do something like

list.map((el,page) => { 
    page.click(el.querySelector('.thing_1'));
    ...
},page)

Is this even possible? If so what’s the correct syntax for it? Every answer I’ve seen on this type of question effectively uses the Javascript Click function and not the Puppeteer click function.

Field not created in mongoDB

I’m am making a post request, where the schema includes a creator field like this

import { Schema, model, models } from 'mongoose';

const PromptSchema = new Schema({
  
  prompt: {
    type: String,
    required: [true, 'Prompt is required.'],
  },
  tag: {
    type: String,
    required: [true, 'Tag is required.'],
  },
  creator: {
    type: Schema.Types.ObjectId,
    ref: 'User',
    required: true
  }
});

const Prompt = models.Prompt || model('Prompt', PromptSchema);

export default Prompt;

the new prompts route in the api is as follows:

import { connectToDB } from "@utils/database";
import Prompt from "@models/prompt";

export const POST = async (req) => {
    const {userId, prompt, tag} = await req.json();
    try {
        await connectToDB()
        const newPrompt = new Prompt({
            prompt, 
            tag,
            creator: userId
        })
        await newPrompt.save();
        return new Response(JSON.stringify(newPrompt), {status: 201})
    } catch (error) {
        return new Response('failed to create a new prompt', {status: 500})
    }
}

the post is being created in the database, but without the creator field

{"_id":{"$oid":"66ed2175514674df2b293ca0"},"prompt":"dandiidida","tag":"#testing","__v":{"$numberInt":"0"}}

i’ve tried calling _id instead of creator in my “populate” function to get all post, image and username but it’s not returning them

How to clone or monkey patch a React Component so one method changes

Let’s say we have

class OriginalComponent extends Component {
  // various code..
  someFunction = () => {
    // does stuff
  }
}

I want to get the functionality of OriginalComponent but with the change that someFunction is replaced with different functionality.

I can think of two possible ways to do this:

  1. Define NewComponent through inheritance:
class NewComponent extends OriginalComponent {
  // various code..
  someFunction = () => {
    // does new stuff
  }
}
  1. Directly change the prototype on OriginalComponent:
OriginalComponent.prototype.methodName = function() 
{ 
  // does new stuff
}

Do both of these methods work? Do they differ? What is recommended here.

I am using a third party library that allows me to pass in overrides for particular React components in the config, for context.

Audio intermitency js

The page is exibit in a TV on a reception. When it’s open we got a dialog with a button to allow the webpage to play audio. And the page refresh itself after 40 seconds.

For the most time of the day, the page is playing the sound, but sometimes, the text is updated but the sound is not heard. And it just come back after a manual refresh(F5). It seems the problem is with the browser. As the page has not user interactions, in addition tobutton to allow the sound, maybe the browser is disabling the sound?

On the manual refresh case, there was no interaction with the page, like a click, just a F5.

Currently we’re using the Audio, should i try with the AudioContext?

We though the problem was with cache, so we created a auto refresh, but it wasn’t enougth to resolve the problem.

i’m expecting now to find a clue about what’s stopping the audio from playing

Odoo Snippet Not Visible in Website Builder After Module Installation

I am developing a custom module for Odoo 16 that adds a BMI calculator snippet to the Website Builder. However, after installing the module, the snippet does not appear in the blocks section of the page editor.
Here’s what I have done so far:

I added my snippet in a snippet_templates.xml file.
I included the CSS and JS files in assets.xml.
My __manifest__.py contains the paths to the views and assets.
The module installs correctly, but the snippet does not show up in the snippets section.

What I’ve tried:

I cleared Odoo’s cache.
I verified that the module is installed correctly.
I tried different methods to inject the snippet into the website.snippets template.

What I expect:
I expect my snippet to appear in the snippet section of Odoo’s page editor, but it’s not visible.

How do I create a userscript that creates a button on a webpage, that when clicked, runs the GM_registerMenuCommand for that userscript?

I have a userscript that includes a GM_registerMenuCommand('Render LaTeX', () => { (and so forth) that makes part of the userscript only run when manually triggered by selecting the ViolentMonkey addon from my browser bar, then clicking the button labeled “Render LaTeX”.

I want to add a button to the webpage this userscript is set to match, which when clicked does the above. I’m just at a loss for how to do so. The only information even regarding buttons I’ve yet been able to find was here.

I’ve tried tinkering with the code provided in the second answer to the linked question. I was able to adjust the text and positioning, but I couldn’t figure out how to make the button do what I want or change its appearance to better fit into the website it’s going on.

// ==UserScript==
// @name        TeX Button
// @namespace   all
// @match     https://mail.google.com/mail/*
// @version     1
// @grant       none
// ==/UserScript==

(function(){
    'use strict'

  window.addEventListener('load', () => {
    addButton('TeX', selectReadFn)
    })

    function addButton(text, onclick, cssObj) {
        cssObj = cssObj || {position: 'absolute', bottom: '92.375%', left:'19.35%', 'z-index': 3}
        let button = document.createElement('button'), btnStyle = button.style
        document.body.appendChild(button)
        button.innerHTML = text
        button.onclick = onclick
        Object.keys(cssObj).forEach(key => btnStyle[key] = cssObj[key])
        return button
    }

    function selectReadFn() {
        [...document.getElementsByClassName('MN')].filter(isRead).forEach(element => element.click())
    }

    function isRead(element) {
        childs = element.parentElement.parentElement.parentElement.getElementsByClassName('G3')
        return ![...childs].some(e => e.innerText.search(/unread/i)!==-1)
    }

}())

Tabs not aligned in Bootstrap Modal

I´m building a Bootstrap Modal and I want to put some tabs inside this Modal to be able to navigate inside him.

What is happenings is that the tabs displayed are not aligned the proper way like in the following image:

enter image description here

I am building this modal in the Javascript with this code:

BootstrapDialog.show({
          title: "Vouchers Details",
          closable: false,
          message: `
             <!-- Criação das tabs -->
    <ul class="nav nav-tabs" role="tablist">
      <li class="nav-item">
        <a class="nav-link active" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-toggle="tab" href="#menu1" role="tab" aria-controls="menu1" aria-selected="false">Menu 1</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" data-toggle="tab" href="#menu2" role="tab" aria-controls="menu2" aria-selected="false">Menu 2</a>
      </li>
    </ul>

    <!-- Conteúdo das tabs -->
    <div class="tab-content mt-3">
      <div id="home" class="tab-pane fade show active" role="tabpanel" aria-labelledby="home-tab">
        <h3>HOME</h3>
        <p>Some content.</p>
      </div>
      <div id="menu1" class="tab-pane fade" role="tabpanel" aria-labelledby="menu1-tab">
        <h3>Menu 1</h3>
        <p>Some content in menu 1.</p>
      </div>
      <div id="menu2" class="tab-pane fade" role="tabpanel" aria-labelledby="menu2-tab">
        <h3>Menu 2</h3>
        <p>Some content in menu 2.</p>
      </div>
    </div>
          `,
          buttons: [
            {
              label: "Dismiss",
              action: function (dialog) {
                dialog.close();
              },
            },
          ],
        });

I need some help to align this tabs.

I try to use some bootstrap classes and some css and html customization, but it did not solve this problem.