Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Milestone/Release Version 1.1.0] New Features & Request #1

Open
wants to merge 48 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
8d46b6d
Documentation and Organisation Update
Nov 1, 2020
4669d85
Formatting Error Fix
Nov 1, 2020
438e84c
npm package change
Nov 1, 2020
2310874
Merge Conflict Resolution for Documentation + NPM Change
Nov 1, 2020
7a1f8c8
ignore NPM Modules built locally
Nov 1, 2020
b26a8b7
Open Repository to Issues
Nov 1, 2020
001a260
Merge pull request #1
Nov 1, 2020
91f15e8
Formatting error
Nov 1, 2020
653c43b
Adds description to README
Nov 1, 2020
d096554
Update CONTRIBUTORS.md
Nov 1, 2020
3a0a622
Update CONTRIBUTORS.md
Nov 1, 2020
9df3aed
Update CONTRIBUTORS.md
Nov 1, 2020
a5a7ca2
Merge pull request #2
Nov 1, 2020
6758fd3
Update README.md
Nov 1, 2020
08dc12f
Update README.md
Nov 1, 2020
a0a18f5
Update README.md
Nov 1, 2020
47c7a4b
Merge pull request #3
Nov 1, 2020
461b5da
developed new script to output JSON + place result in clipboard
Nov 1, 2020
8a4ae58
Capitalisation
Nov 1, 2020
8fd81e0
relative linking
Nov 1, 2020
57807f1
relative linking done right
Nov 1, 2020
35589f4
Merge pull request #4
Nov 1, 2020
9bb0b9a
CircleCI Test Suite for Package.JSON set; incremented npm package ver…
Nov 1, 2020
a374654
Merge pull request #5
Nov 1, 2020
0f90c1e
Add .circleci/config.yml
Nov 1, 2020
59b67a8
Merge pull request #6
Nov 1, 2020
37ec9c4
Merge pull request #7
Nov 1, 2020
c758c01
CircleCI cannot clear terminal; Co-authored-by: Vasilii Kovalev <vasy…
Nov 1, 2020
ae76ddc
Crediting Config.yml Reference
Nov 1, 2020
bd3f141
tests documentatino
Nov 1, 2020
a9831dd
Revert "tests documentatino"
Nov 1, 2020
07edf52
documentation for tests
Nov 1, 2020
3bea067
adding tests status badges
Nov 1, 2020
b8a34c0
Merge pull request #8
Nov 1, 2020
3703fa1
update badges for master branch
Nov 1, 2020
679579c
tests for master branch (fix)
Nov 1, 2020
5bdec39
Crediting config.yml
Nov 1, 2020
eb31a77
Update all development npm dependencies (2020-12-01) (#10)
depfu[bot] Dec 1, 2020
42c5bab
Update all development npm dependencies (2020-12-29) (#11)
depfu[bot] Dec 29, 2020
b5b1037
Update all development npm dependencies (2021-01-26) (#12)
depfu[bot] Jan 26, 2021
ee8a494
Update all development npm dependencies (2021-02-23) (#13)
depfu[bot] Feb 23, 2021
6bb1cc4
Update all development npm dependencies (2021-03-23) (#14)
depfu[bot] Mar 23, 2021
174cee4
Update all development npm dependencies (2021-04-20) (#15)
depfu[bot] Apr 20, 2021
84f35cb
Bump lodash from 4.17.20 to 4.17.21 in /NPM (NodeJS) (#16)
dependabot[bot] May 12, 2021
c109be1
Update all development npm dependencies (2021-05-18) (#17)
depfu[bot] May 18, 2021
c4c9185
Update all development npm dependencies (2021-06-15) (#18)
depfu[bot] Jun 15, 2021
d3632e5
Update all development npm dependencies (2021-07-13) (#19)
depfu[bot] Jul 13, 2021
6569c3e
Update all development npm dependencies (2021-08-10) (#20)
depfu[bot] Aug 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: 2.1

orbs:
node: circleci/[email protected]
jobs:
build_and_test:
docker:
- image: circleci/node:latest
steps:
- checkout
- node/install-packages:
app-dir: ~/project/NPM (NodeJS)
- run:
name: Run linters and tests
command: cd "NPM (NodeJS)" && npm run test-verbose
workflows:
build_and_test:
jobs:
- build_and_test
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to express frustrations & improve this project
title: "[Bug] Bug_(&Suggested_Bug-fix,_if_applicable)_Request"
labels: bug, help wanted
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A description (obvious ones too, these are appreciated!) of what you expected to happen.

**Screenshots**
Any bug with screenshots will be prioritised. Please include them to help explain your problem.

Most desktop and mobile OS have these features, but if you are willing to contribute and are not sure how, state so in this section and I will try to guide you through how to take screenshots.

**Operating Systems Affected**

***Desktop (please complete the following information):***
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

***Smartphone (please complete the following information):***
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here. (Optional, there often won't be such information.)
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Feature request
about: Suggest an idea for this project
title: "[Feature Request] REQUEST_HERE"
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context in text about the feature request here.

**Screenshots**
Add any screenshots (optional only in exceptionally minor) requests, depicting what you want changed (or added/deleted) with the assistance of text-boxes, arrows, and other such markup tools.

Most paint/screenshot/[GIMP](https://www.gimp.org)/image editing programs have these features, but if you need something to get you started I've had good experiences with [PaintZ](https://paintz.app) on the web and [Skitch](https://evernote.com/products/skitch) for Desktop.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.DS_STORE
.DS_Store
NPM (NodeJS)/node_modules/
54 changes: 54 additions & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Contributors

## Technical
In addition to this project there is a [website](https://perimeterx.github.io/map-events-website/) that should show the events map of every (OS + Browser) combination that ever existed.

In reality however, it shows most of the existing combinations, but not all of them.

The original maps were extracted using every existing combination in [browserstack](https://browserstack.com), and some more updates were added from manual testing on relatively new browser versions about a year later, but even in browserstack many automatic combinations have failed + there are missing versions in between the two runs + for future versions not yet maintained.

Also, the working extraction script is not automatic and does not run every time there's a new Browser/OS.

Contributing to the [JSON](https://github.com/perimeterx/map-events-website/blob/master/data.json) could help a lot with maintaining the map and keeping it as updated and as accurate as possible.

## Translations, Formatting, Documentation(, and more!)

Other non-technical contributions are encouraged!

In addition to technical contributions (such as the above),

- contributions to the translations,
- useful formatting changes,
- documentation for the purpose of the site, on the site (and probably other documentation),
- and of course, additions to the [data](https://github.com/alexwiegmanpx/map-events-website/blob/master/data.json) from your browser on your OS
of the [webpage](https://github.com/alexwiegmanpx/map-events-website) are all encouraged.

Please clone and make PRs to either [my version of the repository](https://github.com/alexwiegmanpx/map-events-website) or the [official PX version](https://github.com/PerimeterX/map-events-website).

## List of Contributors

Original Author:

- [Gal Weizman](https://github.com/weizman) | [PerimeterX](https://github.com/galpx)

Currently Maintaining Contributor:

- [Alex T.W.](https://github.com/madicetea) | [PerimeterX](https://github.com/alexwiegmanpx)

Internal Contributors:

(Your name here 🙂)

Community Contributors:

- [Vasilii Kovalev](https://github.com/vasilii-kovalev) for a good refernece in his [config.yml](https://github.com/vasilii-kovalev/games_world/blob/f910483ccd33a6cf58765f70ee6f6823239011e1/.circleci/config.yml) for how to CircleCI test correctly.

(Your name here 🙂)

Everyone's work is highly appreciated. Thank you!

## Disclaimers

While the work is done on behalf of PerimeterX, any tools, processes, hosting providers, programming languages, or etc. used are representative of the authors and contributors of the open source community + not necessarily representative of the official views of PerimeterX. No part of this repository, code, associated websites, or cloned versions of any of thereof be interpreted to favor, endorse, or otherwise bias (positive or negative) towards any person, organisation, company, or other entity.

If there is any questions or suggestions about this, we encourage the community at wide to open an issue for consideration upstream to the official PerimeterX version of the repository.
4 changes: 2 additions & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2019 PerimeterX
Copyright (c) 2019 - PerimeterX

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
117 changes: 117 additions & 0 deletions NPM (NodeJS)/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# NodeJS Guidance

This directory is for those who will use NodeJS to run this.

Personally, I got as far as correctly getting the installation done, but the usage section neither worked in terminal (UNIX/Mac) nor in a VS Code-Started Debug Session within Brave (Chromium).

So, I made a manual script instead.

## installation

`npm install px-map-events --save`

## usage

```javascript
const getEventsMap = require('map-events');

const EventsMap = getEventsMap();
```

## output

a map of all events in the browser in the following format:

```javascript
{
'OBJECT': [
'EVENT1',
'EVENT2',
'EVENT3'
]
}
```

# example

```javascript
const getEventsMap = require('map-events');

const webSocketEventsMap = getEventsMap('WebSocket');

(webSocketEventsMap == {
"WebSocket": [
"open",
"error",
"close",
"message"
] // results in true
});
```

here's an example of how to register with your own listener to every event that exists on `window`!

```javascript

const windowEventsMap = getEventsMap('window')['window'];

for (let i = 0; i < windowEventsMap.length; i++) {
const event = windowEventsMap[i];
window[event] = (event) => { console.log(event) });
}
```

## options

1. `filter` (first optional argument)

allows you to pass a string that must exist within the object in order for it to make it to the final result map:

```javascript
const getEventsMap = require('map-events');

const EventsMap = getEventsMap('*'); // will return a non-filtered map
const EventsMap = getEventsMap('HTML'); // will return a map that only contains objects that contain the string 'HTML' (such as 'HTMLBodyElement')
const EventsMap = getEventsMap('Doc'); // will return a map that only contains objects that contain the string 'Doc' (such as 'Document')
```

default value: `'*'`

2. `hasOwnProperty` (second optional argument)

allows you to pass a boolean that indicates whether iterated object must has iterated property as its own property or not:

```javascript
const getEventsMap = require('map-events');

const EventsMap = getEventsMap('*', true); // will return a map with objects and events properties that are the object's own properties
const EventsMap = getEventsMap('*', false); // will return a map with objects and events properties - whether the properties are the object's own properties or not
```

default value: `true`

3. `noEmptyArrays` (third optional argument)

allows you to pass a boolean that indicates whether final result object should contain objects that have zero events or not:

```javascript
const getEventsMap = require('map-events');

const EventsMap = getEventsMap('*', true, true); // will return a map with objects and events properties only if the object even has any events
const EventsMap = getEventsMap('*', true, false); // will return a map with objects and events properties whether the object has any events or not
```

default value: `false`

4. `debug` (fourth optional argument)

allows you to pass a boolean that indicates whether to run module in debug mode or not. debug mode just logs errors in case any are thrown:

```javascript
const getEventsMap = require('map-events');

const EventsMap = getEventsMap('*', true, true, true); // will run in debug mode
const EventsMap = getEventsMap('*', true, false, false); // will not run in debug mode
```

default value: `false`
78 changes: 78 additions & 0 deletions NPM (NodeJS)/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Title: Output Browser Events from all Prototype Objects for Every Browser
// Purpose: Snippet to insert into Browser Console to output all events of all prototypes for every browser
// Authors: Alexander Wiegman (PerimeterX San Mateo), Gal Weizman (PerimterX Tel Aviv)
// Time of Creation (most recent version): 01 November 2020 03:08 [UTC]
// Extra: Handily adds a function to format the output directly as JSON and put the result into your clipboard, for easy export to file.
// Web: On the web @ JSFiddle -- https://jsfiddle.net/4jcazrf8/1/

//Write guidance to the webpage -- if you want to overwrite DOM, uncomment the below
//document.body.innerHTML = `<h1>${'Open the Console in the Developer Tools to see the result'}</h1>`;

//Optional Console Logging - Descriptive Description is Descriptive?
//console.log('Every event supported by every object in the browser:')

function _isEvent(prop) {
return 0 === prop.indexOf("on");
}

function _getEvents(obj) {
const result = [];

for (var prop in obj) {
if (_isEvent(prop)) {
prop = prop.substr(2); // remove "on" at the beginning
result.push(prop);
}
}

return result;
}

function getEvents() {
const result = {};

result["window"] = _getEvents(window, hasOwnProperty);

const arr = Object.getOwnPropertyNames(window);

let proto;
for (let i = 0; i < arr.length; i++) {
const element = arr[i];

let resultArray = [];

try {
const obj = window[element];

if (!obj || !obj["prototype"]) {
continue;
}

proto = obj["prototype"];

resultArray = _getEvents(proto);

} catch (err) {
// console.error(`failed to get events of %o`, element);
}

result[element] = resultArray;
}

return result;
}

function hasOwnProperty() {
}

//show the result in your browser
console.log(JSON.stringify(getEvents()));

//Copy a JSON of the output of all events in the browser
var consoleOutput = JSON.stringify(getEvents());

copy(consoleOutput);

//optional couple of lines, it helps suppress a few linter errors
function copy(consoleOutput) {
}
File renamed without changes.
Loading