Identify the "Firefox View" tab - firefox

Recently Firefox has introduced a "Firefox View" tab which is like a persistent pinned tab that cannot be closed (except disabling it in the View menu) or navigated out of. This tab is returned by browser.tabs.query.
I want to identify it so it will not be processed by the extension. url property is not a viable option since any tab can be navigated to about:firefoxview
I have noticed that it has hidden set as true. hidden seems to only be a property in the Firefox API, Chrome does not have it. The documentation does not say much about it, but "whether the tab is hidden" - whatever that means (I checked that it is not associated with the tab being in the scrolled out of view section of the tabbar).
So is checking the hidden property to identify the tab a viable option? Or could other tabs also be "hidden"? Are there any better options?
It's properties:
active: false
​​
attention: false
​​
audible: false
​​
cookieStoreId: "firefox-default"
​​
discarded: false
​​
favIconUrl: "chrome://branding/content/icon32.png"
​​
height: 746
​​
hidden: true
​​
highlighted: false
​​
id: 11
​​
incognito: false
​​
index: 1
​​
isArticle: undefined
​​
isInReaderMode: false
​​
lastAccessed: 1667374495857
​​
mutedInfo: Object { muted: false }
​​
pinned: false
​​
sharingState: Object { camera: false, microphone: false, screen: undefined }
​​
status: "complete"
​​
successorTabId: -1
​​
title: "Firefox View"
​​
url: "about:firefoxview"
​​
width: 1351
​​
windowId: 63

Related

Swagger AWS API Gateway with Strict-Transport-Security

I'm trying to use Strict-Transport-Security header with API Gateway on swagger definition, but I keep getting Invalid mapping expression parameter specified: method.response.header.Strict-Transport-Security when I use:
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Strict-Transport-Security: "'max-age=31536000; includeSubdomains; preload'"
Full definition below:
openapi: 3.0.1
info:
title:APIs
version: 1.0.1
servers:
- url: "http://localhost:9001"
security:
- ApiGateway: []
paths:
/user/{id}:
get:
summary: Get user
parameters:
- in: path
name: id
required: true
schema:
type: string
format: uuid
description: return user by ID
responses:
"200":
description: user returned successfully
content:
application/json:
schema:
$ref: "#/components/schemas/User"
"400":
description: Validation failure
"500":
description: Something went wrong
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${apiLambda.Arn}/invocations
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Strict-Transport-Security: "'max-age=31536000; includeSubdomains; preload'"
passthroughBehavior: "never"
httpMethod: "POST"
type: "aws_proxy"
/user:
post:
summary: Create user
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/User"
responses:
"200":
description: User created successfully
"400":
description: Validation failure
"500":
description: Something went wrong
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${apiLambda.Arn}/invocations
responses:
default:
statusCode: "200"
passthroughBehavior: "never"
httpMethod: "POST"
type: "aws_proxy"
components:
securitySchemes:
ApiGateway:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
User:
type: object
required:
- id
- name
properties:
id:
type: string
format: uuid
example: "317d0a1d-1a44-4a47-b2d8-cbe64665591c"
description: "user ID"
name:
type: string
example: "Josiah Morrow"
description: "User name"
minimum: 1
maximum: 50
Unable to put integration response on 'GET' for resource at path '/user/{id}': Invalid mapping expression specified: Validation Result: warnings : [], errors : [Invalid mapping expression parameter specified: method.response.header.Strict-Transport-Security]

Serverless framework - Lambda function with Authorizer COGNITO_USER_POOLS always return "Unauthorized"

I can't figure out what's wrong on my Authorization.
I've a Hello function which only returns a simple a static message. If I deploy without set "Authorizer", it works. I've tested on Postman. The issue starts when I try adding Authorizer.
I've my Cognito fully working. On my front end I can sign up, then do a login and then get the Token from this login session.
When I go to Postman and test, I'm always getting "unauthorized" as answers.
On Postman I test on GET method, on "Headers" tab I added "Authorization" attribute and pasted on value the token that I've from Login session. I also tested this on the value field the prefix "bearer" as some places recommended. No success.
I've been trying for the past week solve this issue. Please, any help will be extremely useful.
serverless.yml
provider:
name: aws
runtime: nodejs10.x
stage: dev
region: eu-west-1
environment:
MY_TABLE: ${self:custom.myStage}_${self:custom.settings.tb_items}
MY_STAGE: ${self:custom.myStage}
MY_DOMAIN: ${self:custom.myDomain}
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:GetItem"
- "dynamodb:PutItem"
- "dynamodb:UpdateItem"
- "dynamodb:DeleteItem"
- "dynamodb:Scan"
Resource: "*"
functions:
hello:
handler: ${self:custom.pathFunc}/phraseOption.hello
events:
- http:
method: GET
path: hello
cors: true
integration: lambda-proxy
authorizer:
type: COGNITO_USER_POOLS
authorizerId:
Ref: ApiGatewayAuthorizer
resources:
Resources:
CognitoUserPool:
Type: "AWS::Cognito::UserPool"
DeletionPolicy: Retain
Properties:
MfaConfiguration: OFF
UserPoolName: ${self:custom.myStage}_aePool
EmailVerificationSubject: 'Your verification Code'
EmailVerificationMessage: 'Use this code to confirm your sign up {####}'
AutoVerifiedAttributes:
- email
UsernameAttributes:
- email
Policies:
PasswordPolicy:
MinimumLength: 6
RequireLowercase: False
RequireNumbers: False
RequireSymbols: False
RequireUppercase: False
CognitoUserPoolClient:
Type: "AWS::Cognito::UserPoolClient"
DeletionPolicy: Retain
Properties:
ClientName: ${self:custom.myStage}_aePoolClient
GenerateSecret: False
UserPoolId:
Ref: CognitoUserPool
ApiGatewayAuthorizer:
Type: AWS::ApiGateway::Authorizer
Properties:
Name: CognitoUserPool
Type: COGNITO_USER_POOLS
IdentitySource: method.request.header.Authorization
RestApiId:
Ref: ApiGatewayRestApi
ProviderARNs:
- Fn::GetAtt:
- CognitoUserPool
- Arn
phraseOptions.js
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Your function executed successfully!',
input: event,
}),
};
callback(null, response);
};
I can see the function was created with the correct Auth:
Also Authorizer create as expected (I guess)
Swagger
---
swagger: "2.0"
info:
version: "2019-10-07T21:24:17Z"
title: "XXXXXX"
host: "XXXXXX"
basePath: "/dev"
schemes:
- "https"
paths:
/getPhrase:
get:
responses: {}
options:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
headers:
Access-Control-Allow-Origin:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Credentials:
type: "string"
Access-Control-Allow-Headers:
type: "string"
/hello:
get:
responses: {}
security:
- CognitoUserPool: []
/item:
post:
responses: {}
options:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
headers:
Access-Control-Allow-Origin:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Credentials:
type: "string"
Access-Control-Allow-Headers:
type: "string"
/item/{itemId}:
get:
responses: {}
put:
responses: {}
delete:
responses: {}
options:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
headers:
Access-Control-Allow-Origin:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Credentials:
type: "string"
Access-Control-Allow-Headers:
type: "string"
/items:
get:
responses: {}
options:
consumes:
- "application/json"
produces:
- "application/json"
responses:
200:
description: "200 response"
headers:
Access-Control-Allow-Origin:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Credentials:
type: "string"
Access-Control-Allow-Headers:
type: "string"
securityDefinitions:
CognitoUserPool:
type: "apiKey"
name: "Authorization"
in: "header"
x-amazon-apigateway-authtype: "cognito_user_pools"
I've figure out what was wrong!
The server side was Ok. The issue on testing it on Postman was the Token.
I was using "cognitoUser.signInUserSession.accessToken.jwtToken", but supposed to be "cognitoUser.signInUserSession.idToken.jwtToken".
Everything working as expected now.

The endpoint api gateway test passes normally, but when deployed, I get error 404

Help me please. What have I done wrong. I want to have access to ec2 via api gataway and wrote a cloudformation template
paths:
/{proxy+}:
x-amazon-apigateway-any-method:
headers:
Access-Control-Allow-Headers:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Origin:
type: "string"
Content-Type:
type: "string"
authority:
type: "string"
produces:
- "application/json"
parameters:
- name: "proxy"
in: "path"
required: false
type: "string"
responses: {}
x-amazon-apigateway-integration:
responses:
default:
statusCode: "200"
uri: "http://ec2-1111111111.eu-west-1.compute.amazonaws.com/{proxy}"
requestParameters:
integration.request.header.Content-Type: "'text/html'"
"integration.request.path.proxy": "method.request.path.proxy"
passthroughBehavior: "when_no_match"
httpMethod: ANY
type: "http_proxy
for this where I defined 1 endpoint http_proxy. When I test this endpoint everything works fine, but as soon as I deploy api and try to get access through the browser, error 404 crashes
After removing and redeploying the stack, I achieved the page display, but still I can’t ensure that the connected css files are connected correctly.

Safari Cannot Load XMLHttpRequest Due to Access Control Checks

I am running into an issue that only occurs on Safari when searching on the website. It also only occurs when a user types and presses enter faster than the search suggestions can load.
The error we receive is: "XMLHTTPRequest cannot load [URL]/?query=testing due to access control checks. All requests are on the same domain so I do not believe this is a CORS problem. Also it appears to happen during the remote function and not the prefetch due error containing /query
The typeahead configuration is found below:
$('#searchIconInput').typeahead({
hint: true,
highlight: true,
minLength: 3
},
{
name: 'searchSuggestionsShown',
source: searchSuggestionEngine
});
});
var searchSuggestionEngine = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
url: '#Url.Action("RetrieveSuggestedSearchItems", "Search")',
ttl: getNumberOfMillisecondsToCachePrefetchedData(),
},
remote: {
url: '#Url.Action("RetrieveAdditionalSuggestedSearchItems", "Search")/?query=',
replace: function (url, uriEncodedQuery) {
return url + uriEncodedQuery;
},
cache: false
}
});

Doctrine inheritance not inserting record into parent table

I've got the following database structure:
Account:
columns:
email: string(255)
name:
type: string(255)
UserRegistered:
columns:
email:
type: string(255)
email: true
notnull: true
unique: true
username:
type: string(255)
notnull: true
nospace: true
unique: true
minlength: 5
password:
type: string(255)
token: string(255)
inheritance:
extends: Account
type: concrete
UserOpenid:
columns:
openid: string(255)
openid_provider: string(255)
inheritance:
extends: Account
type: concrete
When I insert a new UserRegistered or UserOpenid record, I would've expected it to create a UserRegistered record as well as an Account record.
Did I misunderstand inheritance / am I misusing it, or have I done something wrong?
If you use concrete inheritance the master table will always be empty. All fields from the master table are duplicated in the child tables.. therefore there is no need to write to the master table.

Resources