Skip to content

Instantly share code, notes, and snippets.

@wimby
wimby / autocomplete-off.directive.ts
Created August 9, 2022 00:11
form with autocomplete=off
import { AfterViewInit, Directive, ElementRef, Optional, Renderer2, ViewContainerRef } from '@angular/core';
/**
* workaround for Chromium's bug in autocomplete=off
* https://bugs.chromium.org/p/chromium/issues/detail?id=914451
*
* working solution was set autocomplete=<non-standard-value> to each of the form inputs
* and have one unused input without autocomplete
*/
<?php
class Request {
protected $url;
protected $headers;
public function __construct($url, $query = null, array $headers = null) {
$url = $this->buildUrl($url, $query);
if (filter_var($url, FILTER_VALIDATE_URL) === false) {